{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Real time linkage\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "In this notebook, we demonstrate splink's incremental and real time linkage capabilities - specifically:\n",
        "\n",
        "- the `linker.inference.compare_two_records` function, that allows you to interactively explore the results of a linkage model; and\n",
        "- the `linker.find_matches_to_new_records` that allows you to incrementally find matches to a small number of new records\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "<a target=\"_blank\" href=\"https://colab.research.google.com/github/moj-analytical-services/splink/blob/master/docs/demos/examples/duckdb/real_time_record_linkage.ipynb\">\n",
        "  <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
        "</a>\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2024-03-27T15:15:11.870063Z",
          "iopub.status.busy": "2024-03-27T15:15:11.869757Z",
          "iopub.status.idle": "2024-03-27T15:15:11.890661Z",
          "shell.execute_reply": "2024-03-27T15:15:11.889929Z"
        },
        "tags": [
          "hide_input"
        ]
      },
      "outputs": [],
      "source": [
        "# Uncomment and run this cell if you're running in Google Colab.\n",
        "# !pip install ipywidgets\n",
        "# !pip install splink\n",
        "# !jupyter nbextension enable --py widgetsnbextension"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "### Step 1: Load a pre-trained linkage model\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2024-03-27T15:15:11.894528Z",
          "iopub.status.busy": "2024-03-27T15:15:11.894247Z",
          "iopub.status.idle": "2024-03-27T15:15:13.841789Z",
          "shell.execute_reply": "2024-03-27T15:15:13.841226Z"
        }
      },
      "outputs": [],
      "source": [
        "import urllib.request\n",
        "import json\n",
        "from pathlib import Path\n",
        "from splink import Linker, DuckDBAPI, block_on, SettingsCreator, splink_datasets\n",
        "\n",
        "df = splink_datasets.fake_1000\n",
        "\n",
        "url = \"https://raw.githubusercontent.com/moj-analytical-services/splink_demos/master/demo_settings/real_time_settings.json\"\n",
        "\n",
        "with urllib.request.urlopen(url) as u:\n",
        "    settings = json.loads(u.read().decode())\n",
        "\n",
        "\n",
        "linker = Linker(df, settings, db_api=DuckDBAPI())"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2024-03-27T15:15:13.845679Z",
          "iopub.status.busy": "2024-03-27T15:15:13.845274Z",
          "iopub.status.idle": "2024-03-27T15:15:14.721033Z",
          "shell.execute_reply": "2024-03-27T15:15:14.720417Z"
        }
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "<style>\n",
              "  #altair-viz-4211c4909a134b12af62d991bdba22aa.vega-embed {\n",
              "    width: 100%;\n",
              "    display: flex;\n",
              "  }\n",
              "\n",
              "  #altair-viz-4211c4909a134b12af62d991bdba22aa.vega-embed details,\n",
              "  #altair-viz-4211c4909a134b12af62d991bdba22aa.vega-embed details summary {\n",
              "    position: relative;\n",
              "  }\n",
              "</style>\n",
              "<div id=\"altair-viz-4211c4909a134b12af62d991bdba22aa\"></div>\n",
              "<script type=\"text/javascript\">\n",
              "  var VEGA_DEBUG = (typeof VEGA_DEBUG == \"undefined\") ? {} : VEGA_DEBUG;\n",
              "  (function(spec, embedOpt){\n",
              "    let outputDiv = document.currentScript.previousElementSibling;\n",
              "    if (outputDiv.id !== \"altair-viz-4211c4909a134b12af62d991bdba22aa\") {\n",
              "      outputDiv = document.getElementById(\"altair-viz-4211c4909a134b12af62d991bdba22aa\");\n",
              "    }\n",
              "    const paths = {\n",
              "      \"vega\": \"https://cdn.jsdelivr.net/npm/vega@5?noext\",\n",
              "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm/vega-lib?noext\",\n",
              "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm/vega-lite@5.17.0?noext\",\n",
              "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm/vega-embed@6?noext\",\n",
              "    };\n",
              "\n",
              "    function maybeLoadScript(lib, version) {\n",
              "      var key = `${lib.replace(\"-\", \"\")}_version`;\n",
              "      return (VEGA_DEBUG[key] == version) ?\n",
              "        Promise.resolve(paths[lib]) :\n",
              "        new Promise(function(resolve, reject) {\n",
              "          var s = document.createElement('script');\n",
              "          document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
              "          s.async = true;\n",
              "          s.onload = () => {\n",
              "            VEGA_DEBUG[key] = version;\n",
              "            return resolve(paths[lib]);\n",
              "          };\n",
              "          s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
              "          s.src = paths[lib];\n",
              "        });\n",
              "    }\n",
              "\n",
              "    function showError(err) {\n",
              "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
              "      throw err;\n",
              "    }\n",
              "\n",
              "    function displayChart(vegaEmbed) {\n",
              "      vegaEmbed(outputDiv, spec, embedOpt)\n",
              "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
              "    }\n",
              "\n",
              "    if(typeof define === \"function\" && define.amd) {\n",
              "      requirejs.config({paths});\n",
              "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
              "    } else {\n",
              "      maybeLoadScript(\"vega\", \"5\")\n",
              "        .then(() => maybeLoadScript(\"vega-lite\", \"5.17.0\"))\n",
              "        .then(() => maybeLoadScript(\"vega-embed\", \"6\"))\n",
              "        .catch(showError)\n",
              "        .then(() => displayChart(vegaEmbed));\n",
              "    }\n",
              "  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"layer\": [{\"layer\": [{\"mark\": \"rule\", \"encoding\": {\"color\": {\"value\": \"black\"}, \"size\": {\"value\": 0.5}, \"y\": {\"field\": \"zero\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"bar\", \"width\": 60}, \"encoding\": {\"color\": {\"condition\": {\"test\": \"(datum.log2_bayes_factor < 0)\", \"value\": \"red\"}, \"value\": \"green\"}, \"opacity\": {\"condition\": {\"test\": \"datum.column_name == 'Prior match weight' || datum.column_name == 'Final score'\", \"value\": 1}, \"value\": 0.5}, \"tooltip\": [{\"field\": \"column_name\", \"title\": \"Comparison column\", \"type\": \"nominal\"}, {\"field\": \"value_l\", \"title\": \"Value (L)\", \"type\": \"nominal\"}, {\"field\": \"value_r\", \"title\": \"Value (R)\", \"type\": \"nominal\"}, {\"field\": \"label_for_charts\", \"title\": \"Label\", \"type\": \"ordinal\"}, {\"field\": \"sql_condition\", \"title\": \"SQL condition\", \"type\": \"nominal\"}, {\"field\": \"comparison_vector_value\", \"title\": \"Comparison vector value\", \"type\": \"nominal\"}, {\"field\": \"bayes_factor\", \"format\": \",.4f\", \"title\": \"Bayes factor = m/u\", \"type\": \"quantitative\"}, {\"field\": \"log2_bayes_factor\", \"format\": \",.4f\", \"title\": \"Match weight = log2(m/u)\", \"type\": \"quantitative\"}, {\"field\": \"prob\", \"format\": \".4f\", \"title\": \"Cumulative match probability\", \"type\": \"quantitative\"}, {\"field\": \"bayes_factor_description\", \"title\": \"Match weight description\", \"type\": \"nominal\"}], \"x\": {\"axis\": {\"grid\": true, \"labelAlign\": \"center\", \"labelAngle\": -20, \"labelExpr\": \"datum.value == 'Prior' || datum.value == 'Final score' ? '' : datum.value\", \"labelPadding\": 10, \"tickBand\": \"extent\", \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"axis\": {\"grid\": false, \"orient\": \"left\", \"title\": \"Match Weight\"}, \"field\": \"previous_sum\", \"type\": \"quantitative\"}, \"y2\": {\"field\": \"sum\"}}}, {\"mark\": {\"type\": \"text\", \"fontWeight\": \"bold\"}, \"encoding\": {\"color\": {\"value\": \"white\"}, \"text\": {\"condition\": {\"test\": \"abs(datum.log2_bayes_factor) > 1\", \"field\": \"log2_bayes_factor\", \"format\": \".2f\", \"type\": \"nominal\"}, \"value\": \"\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"axis\": {\"orient\": \"left\"}, \"field\": \"center\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"text\", \"baseline\": \"bottom\", \"dy\": -25, \"fontWeight\": \"bold\"}, \"encoding\": {\"color\": {\"value\": \"black\"}, \"text\": {\"field\": \"column_name\", \"type\": \"nominal\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"field\": \"sum_top\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"text\", \"baseline\": \"bottom\", \"dy\": -13, \"fontSize\": 8}, \"encoding\": {\"color\": {\"value\": \"grey\"}, \"text\": {\"field\": \"value_l\", \"type\": \"nominal\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"field\": \"sum_top\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"text\", \"baseline\": \"bottom\", \"dy\": -5, \"fontSize\": 8}, \"encoding\": {\"color\": {\"value\": \"grey\"}, \"text\": {\"field\": \"value_r\", \"type\": \"nominal\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"field\": \"sum_top\", \"type\": \"quantitative\"}}}]}, {\"mark\": {\"type\": \"rule\", \"color\": \"black\", \"strokeWidth\": 2, \"x2Offset\": 30, \"xOffset\": -30}, \"encoding\": {\"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"x2\": {\"field\": \"lead\"}, \"y\": {\"axis\": {\"labelExpr\": \"format(1 / (1 + pow(2, -1*datum.value)), '.2r')\", \"orient\": \"right\", \"title\": \"Probability\"}, \"field\": \"sum\", \"scale\": {\"zero\": false}, \"type\": \"quantitative\"}}}], \"data\": {\"name\": \"data-653b3db43b937ef7e5b33cff20c3b5fa\"}, \"height\": 450, \"params\": [{\"name\": \"record_number\", \"bind\": {\"input\": \"range\", \"max\": 1, \"min\": 0, \"step\": 1}, \"value\": 0}], \"resolve\": {\"axis\": {\"y\": \"independent\"}}, \"title\": {\"text\": \"Match weights waterfall chart\", \"subtitle\": \"How each comparison contributes to the final match score\"}, \"transform\": [{\"filter\": \"(datum.record_number == record_number)\"}, {\"filter\": \"(datum.bayes_factor !== 1.0)\"}, {\"window\": [{\"op\": \"sum\", \"field\": \"log2_bayes_factor\", \"as\": \"sum\"}, {\"op\": \"lead\", \"field\": \"column_name\", \"as\": \"lead\"}], \"frame\": [null, 0]}, {\"calculate\": \"datum.column_name === \\\"Final score\\\" ? datum.sum - datum.log2_bayes_factor : datum.sum\", \"as\": \"sum\"}, {\"calculate\": \"datum.lead === null ? datum.column_name : datum.lead\", \"as\": \"lead\"}, {\"calculate\": \"datum.column_name === \\\"Final score\\\" || datum.column_name === \\\"Prior match weight\\\" ? 0 : datum.sum - datum.log2_bayes_factor\", \"as\": \"previous_sum\"}, {\"calculate\": \"datum.sum > datum.previous_sum ? datum.column_name : \\\"\\\"\", \"as\": \"top_label\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? datum.column_name : \\\"\\\"\", \"as\": \"bottom_label\"}, {\"calculate\": \"datum.sum > datum.previous_sum ? datum.sum : datum.previous_sum\", \"as\": \"sum_top\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? datum.sum : datum.previous_sum\", \"as\": \"sum_bottom\"}, {\"calculate\": \"(datum.sum + datum.previous_sum) / 2\", \"as\": \"center\"}, {\"calculate\": \"(datum.log2_bayes_factor > 0 ? \\\"+\\\" : \\\"\\\") + datum.log2_bayes_factor\", \"as\": \"text_log2_bayes_factor\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? 4 : -4\", \"as\": \"dy\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? \\\"top\\\" : \\\"bottom\\\"\", \"as\": \"baseline\"}, {\"calculate\": \"1. / (1 + pow(2, -1.*datum.sum))\", \"as\": \"prob\"}, {\"calculate\": \"0*datum.sum\", \"as\": \"zero\"}], \"width\": {\"step\": 75}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v5.9.3.json\", \"datasets\": {\"data-653b3db43b937ef7e5b33cff20c3b5fa\": [{\"column_name\": \"Prior\", \"label_for_charts\": \"Starting match weight (prior)\", \"sql_condition\": null, \"log2_bayes_factor\": -5.391889789559854, \"bayes_factor\": 0.023816582302252427, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 0, \"record_number\": 0}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.21528549148688833, \"u_probability\": 0.9840865266118626, \"bayes_factor\": 0.21876683164040506, \"log2_bayes_factor\": -2.1925340745596764, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.57 times less likely to be a match\", \"column_name\": \"first_name\", \"value_l\": \"Olirev\", \"value_r\": \"Maryam\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 1, \"record_number\": 0}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.21528549148688833, \"u_probability\": 0.9840865266118626, \"bayes_factor\": 1.0, \"log2_bayes_factor\": 0.0, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.57 times less likely to be a match\", \"column_name\": \"tf_first_name\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 2, \"record_number\": 0}, {\"sql_condition\": \"surname_l = surname_r\", \"label_for_charts\": \"exact_match\", \"m_probability\": 0.4517645215191846, \"u_probability\": 0.004889975550122249, \"bayes_factor\": 92.38584465067325, \"log2_bayes_factor\": 6.529599913880287, \"comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 92.39 times more likely to be a match\", \"column_name\": \"surname\", \"value_l\": \"Jones\", \"value_r\": \"Jones\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 3, \"record_number\": 0}, {\"sql_condition\": \"surname_l = surname_r\", \"label_for_charts\": \"Term freq adjustment on surname with weight {cl.tf_adjustment_weight}\", \"m_probability\": null, \"u_probability\": null, \"bayes_factor\": 0.17412565111087489, \"log2_bayes_factor\": -2.521799347357753, \"comparison_vector_value\": 2, \"bayes_factor_description\": \"Term frequency adjustment on surname makes comparison  5.74 times less likely to be a match\", \"column_name\": \"tf_surname\", \"value_l\": \"Jones\", \"value_r\": \"Jones\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 4, \"record_number\": 0}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.22653362300553073, \"u_probability\": 0.9811331331331331, \"bayes_factor\": 0.23088978993311773, \"log2_bayes_factor\": -2.114723717091652, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.33 times less likely to be a match\", \"column_name\": \"dob\", \"value_l\": \"1991-08-29\", \"value_r\": \"1992-07-06\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 5, \"record_number\": 0}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.22653362300553073, \"u_probability\": 0.9811331331331331, \"bayes_factor\": 1.0, \"log2_bayes_factor\": 0.0, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.33 times less likely to be a match\", \"column_name\": \"tf_dob\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 6, \"record_number\": 0}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.4217855099035769, \"u_probability\": 0.9448524288198547, \"bayes_factor\": 0.4464035832880252, \"log2_bayes_factor\": -1.1635794871398053, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.24 times less likely to be a match\", \"column_name\": \"city\", \"value_l\": \"London\", \"value_r\": \"Coventry\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 7, \"record_number\": 0}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.4217855099035769, \"u_probability\": 0.9448524288198547, \"bayes_factor\": 1.0, \"log2_bayes_factor\": 0.0, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.24 times less likely to be a match\", \"column_name\": \"tf_city\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 8, \"record_number\": 0}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor\": 0.4234380485302649, \"log2_bayes_factor\": -1.239777184635766, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"column_name\": \"email\", \"value_l\": \"oliverjones82@bond.biz\", \"value_r\": \"maryam.j47@myers.com\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 9, \"record_number\": 0}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor\": 1.0, \"log2_bayes_factor\": 0.0, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"column_name\": \"tf_email\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 10, \"record_number\": 0}, {\"column_name\": \"Final score\", \"label_for_charts\": \"Final score\", \"sql_condition\": null, \"log2_bayes_factor\": -8.09470368646422, \"bayes_factor\": 0.0036580647152475937, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 11, \"record_number\": 0}, {\"column_name\": \"Prior\", \"label_for_charts\": \"Starting match weight (prior)\", \"sql_condition\": null, \"log2_bayes_factor\": -5.391889789559854, \"bayes_factor\": 0.023816582302252427, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 0, \"record_number\": 1}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.21528549148688833, \"u_probability\": 0.9840865266118626, \"bayes_factor\": 0.21876683164040506, \"log2_bayes_factor\": -2.1925340745596764, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.57 times less likely to be a match\", \"column_name\": \"first_name\", \"value_l\": \"Olirev\", \"value_r\": \"Isaac\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 1, \"record_number\": 1}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.21528549148688833, \"u_probability\": 0.9840865266118626, \"bayes_factor\": 1.0, \"log2_bayes_factor\": 0.0, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.57 times less likely to be a match\", \"column_name\": \"tf_first_name\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 2, \"record_number\": 1}, {\"sql_condition\": \"surname_l = surname_r\", \"label_for_charts\": \"exact_match\", \"m_probability\": 0.4517645215191846, \"u_probability\": 0.004889975550122249, \"bayes_factor\": 92.38584465067325, \"log2_bayes_factor\": 6.529599913880287, \"comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 92.39 times more likely to be a match\", \"column_name\": \"surname\", \"value_l\": \"Jones\", \"value_r\": \"Jones\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 3, \"record_number\": 1}, {\"sql_condition\": \"surname_l = surname_r\", \"label_for_charts\": \"Term freq adjustment on surname with weight {cl.tf_adjustment_weight}\", \"m_probability\": null, \"u_probability\": null, \"bayes_factor\": 0.17412565111087489, \"log2_bayes_factor\": -2.521799347357753, \"comparison_vector_value\": 2, \"bayes_factor_description\": \"Term frequency adjustment on surname makes comparison  5.74 times less likely to be a match\", \"column_name\": \"tf_surname\", \"value_l\": \"Jones\", \"value_r\": \"Jones\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 4, \"record_number\": 1}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.22653362300553073, \"u_probability\": 0.9811331331331331, \"bayes_factor\": 0.23088978993311773, \"log2_bayes_factor\": -2.114723717091652, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.33 times less likely to be a match\", \"column_name\": \"dob\", \"value_l\": \"1991-08-29\", \"value_r\": \"2008-02-23\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 5, \"record_number\": 1}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.22653362300553073, \"u_probability\": 0.9811331331331331, \"bayes_factor\": 1.0, \"log2_bayes_factor\": 0.0, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.33 times less likely to be a match\", \"column_name\": \"tf_dob\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 6, \"record_number\": 1}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.4217855099035769, \"u_probability\": 0.9448524288198547, \"bayes_factor\": 0.4464035832880252, \"log2_bayes_factor\": -1.1635794871398053, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.24 times less likely to be a match\", \"column_name\": \"city\", \"value_l\": \"London\", \"value_r\": \"Baltasf\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 7, \"record_number\": 1}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.4217855099035769, \"u_probability\": 0.9448524288198547, \"bayes_factor\": 1.0, \"log2_bayes_factor\": 0.0, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.24 times less likely to be a match\", \"column_name\": \"tf_city\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 8, \"record_number\": 1}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor\": 0.4234380485302649, \"log2_bayes_factor\": -1.239777184635766, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"column_name\": \"email\", \"value_l\": \"oliverjones82@bond.biz\", \"value_r\": \"isaac.jones54@bradford.enet\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 9, \"record_number\": 1}, {\"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor\": 1.0, \"log2_bayes_factor\": 0.0, \"comparison_vector_value\": 0, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"column_name\": \"tf_email\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 10, \"record_number\": 1}, {\"column_name\": \"Final score\", \"label_for_charts\": \"Final score\", \"sql_condition\": null, \"log2_bayes_factor\": -8.09470368646422, \"bayes_factor\": 0.0036580647152475937, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 11, \"record_number\": 1}]}}, {\"mode\": \"vega-lite\"});\n",
              "</script>"
            ],
            "text/plain": [
              "alt.LayerChart(...)"
            ]
          },
          "execution_count": 3,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "linker.visualisations.waterfall_chart(\n",
        "    linker.inference.predict().as_record_dict(limit=2)\n",
        ")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "### Step Comparing two records\n",
        "\n",
        "It's now possible to compute a match weight for any two records using `linker.inference.compare_two_records()`\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2024-03-27T15:15:14.724585Z",
          "iopub.status.busy": "2024-03-27T15:15:14.724327Z",
          "iopub.status.idle": "2024-03-27T15:15:14.962647Z",
          "shell.execute_reply": "2024-03-27T15:15:14.961740Z"
        }
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>match_weight</th>\n",
              "      <th>match_probability</th>\n",
              "      <th>unique_id_l</th>\n",
              "      <th>unique_id_r</th>\n",
              "      <th>first_name_l</th>\n",
              "      <th>first_name_r</th>\n",
              "      <th>gamma_first_name</th>\n",
              "      <th>tf_first_name_l</th>\n",
              "      <th>tf_first_name_r</th>\n",
              "      <th>bf_first_name</th>\n",
              "      <th>...</th>\n",
              "      <th>bf_city</th>\n",
              "      <th>bf_tf_adj_city</th>\n",
              "      <th>email_l</th>\n",
              "      <th>email_r</th>\n",
              "      <th>gamma_email</th>\n",
              "      <th>tf_email_l</th>\n",
              "      <th>tf_email_r</th>\n",
              "      <th>bf_email</th>\n",
              "      <th>bf_tf_adj_email</th>\n",
              "      <th>match_key</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>13.161672</td>\n",
              "      <td>0.999891</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Lucas</td>\n",
              "      <td>Lucas</td>\n",
              "      <td>2</td>\n",
              "      <td>0.001203</td>\n",
              "      <td>0.001203</td>\n",
              "      <td>87.571229</td>\n",
              "      <td>...</td>\n",
              "      <td>0.446404</td>\n",
              "      <td>1.0</td>\n",
              "      <td>lucas.smith@hotmail.com</td>\n",
              "      <td>lucas.smith@hotmail.com</td>\n",
              "      <td>1</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>263.229168</td>\n",
              "      <td>1.0</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>1 rows × 40 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "   match_weight  match_probability  unique_id_l  unique_id_r first_name_l  \\\n",
              "0     13.161672           0.999891            1            2        Lucas   \n",
              "\n",
              "  first_name_r  gamma_first_name  tf_first_name_l  tf_first_name_r  \\\n",
              "0        Lucas                 2         0.001203         0.001203   \n",
              "\n",
              "   bf_first_name  ...   bf_city bf_tf_adj_city                  email_l  \\\n",
              "0      87.571229  ...  0.446404            1.0  lucas.smith@hotmail.com   \n",
              "\n",
              "                   email_r  gamma_email  tf_email_l  tf_email_r    bf_email  \\\n",
              "0  lucas.smith@hotmail.com            1         NaN         NaN  263.229168   \n",
              "\n",
              "  bf_tf_adj_email match_key  \n",
              "0             1.0         0  \n",
              "\n",
              "[1 rows x 40 columns]"
            ]
          },
          "execution_count": 4,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "record_1 = {\n",
        "    \"unique_id\": 1,\n",
        "    \"first_name\": \"Lucas\",\n",
        "    \"surname\": \"Smith\",\n",
        "    \"dob\": \"1984-01-02\",\n",
        "    \"city\": \"London\",\n",
        "    \"email\": \"lucas.smith@hotmail.com\",\n",
        "}\n",
        "\n",
        "record_2 = {\n",
        "    \"unique_id\": 2,\n",
        "    \"first_name\": \"Lucas\",\n",
        "    \"surname\": \"Smith\",\n",
        "    \"dob\": \"1983-02-12\",\n",
        "    \"city\": \"Machester\",\n",
        "    \"email\": \"lucas.smith@hotmail.com\",\n",
        "}\n",
        "\n",
        "linker._settings_obj._retain_intermediate_calculation_columns = True\n",
        "\n",
        "\n",
        "# To `compare_two_records` the linker needs to compute term frequency tables\n",
        "# If you have precomputed tables, you can linker.table_management.register_term_frequency_lookup()\n",
        "linker.table_management.compute_tf_table(\"first_name\")\n",
        "linker.table_management.compute_tf_table(\"surname\")\n",
        "linker.table_management.compute_tf_table(\"dob\")\n",
        "linker.table_management.compute_tf_table(\"city\")\n",
        "linker.table_management.compute_tf_table(\"email\")\n",
        "\n",
        "\n",
        "df_two = linker.inference.compare_two_records(record_1, record_2)\n",
        "df_two.as_pandas_dataframe()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "### Step 3: Interactive comparisons\n",
        "\n",
        "One interesting applicatin of `compare_two_records` is to create a simple interface that allows the user to input two records interactively, and get real time feedback.\n",
        "\n",
        "In the following cell we use `ipywidets` for this purpose. ✨✨ Change the values in the text boxes to see the waterfall chart update in real time. ✨✨\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 10,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2024-03-27T15:15:14.968237Z",
          "iopub.status.busy": "2024-03-27T15:15:14.967899Z",
          "iopub.status.idle": "2024-03-27T15:15:15.926984Z",
          "shell.execute_reply": "2024-03-27T15:15:15.925656Z"
        }
      },
      "outputs": [
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "d3c8f243ce6848518e4fe3093cb9422a",
              "version_major": 2,
              "version_minor": 0
            },
            "text/plain": [
              "HBox(children=(VBox(children=(Text(value='1', description='unique_id'), Text(value='Lucas', description='first…"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "f04362ad6bd648f8839b8e7048c9f6f6",
              "version_major": 2,
              "version_minor": 0
            },
            "text/plain": [
              "Output()"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "import ipywidgets as widgets\n",
        "from IPython.display import display\n",
        "\n",
        "\n",
        "fields = [\"unique_id\", \"first_name\", \"surname\", \"dob\", \"email\", \"city\"]\n",
        "\n",
        "left_text_boxes = []\n",
        "right_text_boxes = []\n",
        "\n",
        "inputs_to_interactive_output = {}\n",
        "\n",
        "for f in fields:\n",
        "    wl = widgets.Text(description=f, value=str(record_1[f]))\n",
        "    left_text_boxes.append(wl)\n",
        "    inputs_to_interactive_output[f\"{f}_l\"] = wl\n",
        "    wr = widgets.Text(description=f, value=str(record_2[f]))\n",
        "    right_text_boxes.append(wr)\n",
        "    inputs_to_interactive_output[f\"{f}_r\"] = wr\n",
        "\n",
        "b1 = widgets.VBox(left_text_boxes)\n",
        "b2 = widgets.VBox(right_text_boxes)\n",
        "ui = widgets.HBox([b1, b2])\n",
        "\n",
        "\n",
        "def myfn(**kwargs):\n",
        "    my_args = dict(kwargs)\n",
        "\n",
        "    record_left = {}\n",
        "    record_right = {}\n",
        "\n",
        "    for key, value in my_args.items():\n",
        "        if value == \"\":\n",
        "            value = None\n",
        "        if key.endswith(\"_l\"):\n",
        "            record_left[key[:-2]] = value\n",
        "        elif key.endswith(\"_r\"):\n",
        "            record_right[key[:-2]] = value\n",
        "\n",
        "    # Assuming 'linker' is defined earlier in your code\n",
        "    linker._settings_obj._retain_intermediate_calculation_columns = True\n",
        "\n",
        "    df_two = linker.inference.compare_two_records(record_left, record_right)\n",
        "\n",
        "    recs = df_two.as_pandas_dataframe().to_dict(orient=\"records\")\n",
        "\n",
        "    display(linker.visualisations.waterfall_chart(recs, filter_nulls=False))\n",
        "\n",
        "\n",
        "out = widgets.interactive_output(myfn, inputs_to_interactive_output)\n",
        "\n",
        "display(ui, out)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Finding matching records interactively\n",
        "\n",
        "It is also possible to search the records in the input dataset rapidly using the `linker.find_matches_to_new_records()` function\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2024-03-27T15:15:15.937800Z",
          "iopub.status.busy": "2024-03-27T15:15:15.935943Z",
          "iopub.status.idle": "2024-03-27T15:15:16.477834Z",
          "shell.execute_reply": "2024-03-27T15:15:16.474896Z"
        }
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>match_weight</th>\n",
              "      <th>match_probability</th>\n",
              "      <th>unique_id_l</th>\n",
              "      <th>unique_id_r</th>\n",
              "      <th>first_name_l</th>\n",
              "      <th>first_name_r</th>\n",
              "      <th>gamma_first_name</th>\n",
              "      <th>tf_first_name_l</th>\n",
              "      <th>tf_first_name_r</th>\n",
              "      <th>bf_first_name</th>\n",
              "      <th>...</th>\n",
              "      <th>tf_city_r</th>\n",
              "      <th>bf_city</th>\n",
              "      <th>bf_tf_adj_city</th>\n",
              "      <th>email_l</th>\n",
              "      <th>email_r</th>\n",
              "      <th>gamma_email</th>\n",
              "      <th>tf_email_l</th>\n",
              "      <th>tf_email_r</th>\n",
              "      <th>bf_email</th>\n",
              "      <th>bf_tf_adj_email</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>23.531793</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>0</td>\n",
              "      <td>123987</td>\n",
              "      <td>Robert</td>\n",
              "      <td>Robert</td>\n",
              "      <td>2</td>\n",
              "      <td>0.003610</td>\n",
              "      <td>0.00361</td>\n",
              "      <td>87.571229</td>\n",
              "      <td>...</td>\n",
              "      <td>0.212792</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>robert255@smith.net</td>\n",
              "      <td>robert255@smith.net</td>\n",
              "      <td>1</td>\n",
              "      <td>0.001267</td>\n",
              "      <td>0.001267</td>\n",
              "      <td>263.229168</td>\n",
              "      <td>1.730964</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>14.550320</td>\n",
              "      <td>0.999958</td>\n",
              "      <td>1</td>\n",
              "      <td>123987</td>\n",
              "      <td>Robert</td>\n",
              "      <td>Robert</td>\n",
              "      <td>2</td>\n",
              "      <td>0.003610</td>\n",
              "      <td>0.00361</td>\n",
              "      <td>87.571229</td>\n",
              "      <td>...</td>\n",
              "      <td>0.212792</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>roberta25@smith.net</td>\n",
              "      <td>robert255@smith.net</td>\n",
              "      <td>0</td>\n",
              "      <td>0.002535</td>\n",
              "      <td>0.001267</td>\n",
              "      <td>0.423438</td>\n",
              "      <td>1.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>10.388623</td>\n",
              "      <td>0.999255</td>\n",
              "      <td>3</td>\n",
              "      <td>123987</td>\n",
              "      <td>Robert</td>\n",
              "      <td>Robert</td>\n",
              "      <td>2</td>\n",
              "      <td>0.003610</td>\n",
              "      <td>0.00361</td>\n",
              "      <td>87.571229</td>\n",
              "      <td>...</td>\n",
              "      <td>0.212792</td>\n",
              "      <td>0.446404</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>None</td>\n",
              "      <td>robert255@smith.net</td>\n",
              "      <td>-1</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0.001267</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>1.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>2.427256</td>\n",
              "      <td>0.843228</td>\n",
              "      <td>2</td>\n",
              "      <td>123987</td>\n",
              "      <td>Rob</td>\n",
              "      <td>Robert</td>\n",
              "      <td>0</td>\n",
              "      <td>0.001203</td>\n",
              "      <td>0.00361</td>\n",
              "      <td>0.218767</td>\n",
              "      <td>...</td>\n",
              "      <td>0.212792</td>\n",
              "      <td>10.484859</td>\n",
              "      <td>0.259162</td>\n",
              "      <td>roberta25@smith.net</td>\n",
              "      <td>robert255@smith.net</td>\n",
              "      <td>0</td>\n",
              "      <td>0.002535</td>\n",
              "      <td>0.001267</td>\n",
              "      <td>0.423438</td>\n",
              "      <td>1.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>-2.123090</td>\n",
              "      <td>0.186697</td>\n",
              "      <td>8</td>\n",
              "      <td>123987</td>\n",
              "      <td>None</td>\n",
              "      <td>Robert</td>\n",
              "      <td>-1</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0.00361</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>...</td>\n",
              "      <td>0.212792</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>None</td>\n",
              "      <td>robert255@smith.net</td>\n",
              "      <td>-1</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0.001267</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>1.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>-2.205894</td>\n",
              "      <td>0.178139</td>\n",
              "      <td>754</td>\n",
              "      <td>123987</td>\n",
              "      <td>None</td>\n",
              "      <td>Robert</td>\n",
              "      <td>-1</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0.00361</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>...</td>\n",
              "      <td>0.212792</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>j.c@whige.wort</td>\n",
              "      <td>robert255@smith.net</td>\n",
              "      <td>0</td>\n",
              "      <td>0.001267</td>\n",
              "      <td>0.001267</td>\n",
              "      <td>0.423438</td>\n",
              "      <td>1.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>-2.802309</td>\n",
              "      <td>0.125383</td>\n",
              "      <td>750</td>\n",
              "      <td>123987</td>\n",
              "      <td>None</td>\n",
              "      <td>Robert</td>\n",
              "      <td>-1</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0.00361</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>...</td>\n",
              "      <td>0.212792</td>\n",
              "      <td>10.484859</td>\n",
              "      <td>0.259162</td>\n",
              "      <td>j.c@white.org</td>\n",
              "      <td>robert255@smith.net</td>\n",
              "      <td>0</td>\n",
              "      <td>0.002535</td>\n",
              "      <td>0.001267</td>\n",
              "      <td>0.423438</td>\n",
              "      <td>1.000000</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>7 rows × 39 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "   match_weight  match_probability  unique_id_l  unique_id_r first_name_l  \\\n",
              "6     23.531793           1.000000            0       123987       Robert   \n",
              "5     14.550320           0.999958            1       123987       Robert   \n",
              "4     10.388623           0.999255            3       123987       Robert   \n",
              "3      2.427256           0.843228            2       123987          Rob   \n",
              "2     -2.123090           0.186697            8       123987         None   \n",
              "1     -2.205894           0.178139          754       123987         None   \n",
              "0     -2.802309           0.125383          750       123987         None   \n",
              "\n",
              "  first_name_r  gamma_first_name  tf_first_name_l  tf_first_name_r  \\\n",
              "6       Robert                 2         0.003610          0.00361   \n",
              "5       Robert                 2         0.003610          0.00361   \n",
              "4       Robert                 2         0.003610          0.00361   \n",
              "3       Robert                 0         0.001203          0.00361   \n",
              "2       Robert                -1              NaN          0.00361   \n",
              "1       Robert                -1              NaN          0.00361   \n",
              "0       Robert                -1              NaN          0.00361   \n",
              "\n",
              "   bf_first_name  ...  tf_city_r    bf_city bf_tf_adj_city  \\\n",
              "6      87.571229  ...   0.212792   1.000000       1.000000   \n",
              "5      87.571229  ...   0.212792   1.000000       1.000000   \n",
              "4      87.571229  ...   0.212792   0.446404       1.000000   \n",
              "3       0.218767  ...   0.212792  10.484859       0.259162   \n",
              "2       1.000000  ...   0.212792   1.000000       1.000000   \n",
              "1       1.000000  ...   0.212792   1.000000       1.000000   \n",
              "0       1.000000  ...   0.212792  10.484859       0.259162   \n",
              "\n",
              "               email_l              email_r  gamma_email  tf_email_l  \\\n",
              "6  robert255@smith.net  robert255@smith.net            1    0.001267   \n",
              "5  roberta25@smith.net  robert255@smith.net            0    0.002535   \n",
              "4                 None  robert255@smith.net           -1         NaN   \n",
              "3  roberta25@smith.net  robert255@smith.net            0    0.002535   \n",
              "2                 None  robert255@smith.net           -1         NaN   \n",
              "1       j.c@whige.wort  robert255@smith.net            0    0.001267   \n",
              "0        j.c@white.org  robert255@smith.net            0    0.002535   \n",
              "\n",
              "   tf_email_r    bf_email bf_tf_adj_email  \n",
              "6    0.001267  263.229168        1.730964  \n",
              "5    0.001267    0.423438        1.000000  \n",
              "4    0.001267    1.000000        1.000000  \n",
              "3    0.001267    0.423438        1.000000  \n",
              "2    0.001267    1.000000        1.000000  \n",
              "1    0.001267    0.423438        1.000000  \n",
              "0    0.001267    0.423438        1.000000  \n",
              "\n",
              "[7 rows x 39 columns]"
            ]
          },
          "execution_count": 6,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "record = {\n",
        "    \"unique_id\": 123987,\n",
        "    \"first_name\": \"Robert\",\n",
        "    \"surname\": \"Alan\",\n",
        "    \"dob\": \"1971-05-24\",\n",
        "    \"city\": \"London\",\n",
        "    \"email\": \"robert255@smith.net\",\n",
        "}\n",
        "\n",
        "\n",
        "df_inc = linker.inference.find_matches_to_new_records(\n",
        "    [record], blocking_rules=[]\n",
        ").as_pandas_dataframe()\n",
        "df_inc.sort_values(\"match_weight\", ascending=False)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Interactive interface for finding records\n",
        "\n",
        "Again, we can use `ipywidgets` to build an interactive interface for the `linker.find_matches_to_new_records` function\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2024-03-27T15:15:16.486337Z",
          "iopub.status.busy": "2024-03-27T15:15:16.484941Z",
          "iopub.status.idle": "2024-03-27T15:15:17.549243Z",
          "shell.execute_reply": "2024-03-27T15:15:17.548423Z"
        }
      },
      "outputs": [
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "4ae33c34076a42088ad5b52beb7a8112",
              "version_major": 2,
              "version_minor": 0
            },
            "text/plain": [
              "interactive(children=(Text(value='Robert', description='first_name'), Text(value='Alan', description='surname'…"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "@widgets.interact(\n",
        "    first_name=\"Robert\",\n",
        "    surname=\"Alan\",\n",
        "    dob=\"1971-05-24\",\n",
        "    city=\"London\",\n",
        "    email=\"robert255@smith.net\",\n",
        ")\n",
        "def interactive_link(first_name, surname, dob, city, email):\n",
        "    record = {\n",
        "        \"unique_id\": 123987,\n",
        "        \"first_name\": first_name,\n",
        "        \"surname\": surname,\n",
        "        \"dob\": dob,\n",
        "        \"city\": city,\n",
        "        \"email\": email,\n",
        "        \"group\": 0,\n",
        "    }\n",
        "\n",
        "    for key in record.keys():\n",
        "        if type(record[key]) == str:\n",
        "            if record[key].strip() == \"\":\n",
        "                record[key] = None\n",
        "\n",
        "    df_inc = linker.inference.find_matches_to_new_records(\n",
        "        [record], blocking_rules=[f\"(true)\"]\n",
        "    ).as_pandas_dataframe()\n",
        "    df_inc = df_inc.sort_values(\"match_weight\", ascending=False)\n",
        "    recs = df_inc.to_dict(orient=\"records\")\n",
        "\n",
        "    display(linker.visualisations.waterfall_chart(recs, filter_nulls=False))"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 8,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2024-03-27T15:15:17.555875Z",
          "iopub.status.busy": "2024-03-27T15:15:17.555576Z",
          "iopub.status.idle": "2024-03-27T15:15:17.884897Z",
          "shell.execute_reply": "2024-03-27T15:15:17.884033Z"
        }
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "<style>\n",
              "  #altair-viz-dee4aa39519148f1a9f38dfb65b7e80b.vega-embed {\n",
              "    width: 100%;\n",
              "    display: flex;\n",
              "  }\n",
              "\n",
              "  #altair-viz-dee4aa39519148f1a9f38dfb65b7e80b.vega-embed details,\n",
              "  #altair-viz-dee4aa39519148f1a9f38dfb65b7e80b.vega-embed details summary {\n",
              "    position: relative;\n",
              "  }\n",
              "</style>\n",
              "<div id=\"altair-viz-dee4aa39519148f1a9f38dfb65b7e80b\"></div>\n",
              "<script type=\"text/javascript\">\n",
              "  var VEGA_DEBUG = (typeof VEGA_DEBUG == \"undefined\") ? {} : VEGA_DEBUG;\n",
              "  (function(spec, embedOpt){\n",
              "    let outputDiv = document.currentScript.previousElementSibling;\n",
              "    if (outputDiv.id !== \"altair-viz-dee4aa39519148f1a9f38dfb65b7e80b\") {\n",
              "      outputDiv = document.getElementById(\"altair-viz-dee4aa39519148f1a9f38dfb65b7e80b\");\n",
              "    }\n",
              "    const paths = {\n",
              "      \"vega\": \"https://cdn.jsdelivr.net/npm/vega@5?noext\",\n",
              "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm/vega-lib?noext\",\n",
              "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm/vega-lite@5.17.0?noext\",\n",
              "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm/vega-embed@6?noext\",\n",
              "    };\n",
              "\n",
              "    function maybeLoadScript(lib, version) {\n",
              "      var key = `${lib.replace(\"-\", \"\")}_version`;\n",
              "      return (VEGA_DEBUG[key] == version) ?\n",
              "        Promise.resolve(paths[lib]) :\n",
              "        new Promise(function(resolve, reject) {\n",
              "          var s = document.createElement('script');\n",
              "          document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
              "          s.async = true;\n",
              "          s.onload = () => {\n",
              "            VEGA_DEBUG[key] = version;\n",
              "            return resolve(paths[lib]);\n",
              "          };\n",
              "          s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
              "          s.src = paths[lib];\n",
              "        });\n",
              "    }\n",
              "\n",
              "    function showError(err) {\n",
              "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
              "      throw err;\n",
              "    }\n",
              "\n",
              "    function displayChart(vegaEmbed) {\n",
              "      vegaEmbed(outputDiv, spec, embedOpt)\n",
              "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
              "    }\n",
              "\n",
              "    if(typeof define === \"function\" && define.amd) {\n",
              "      requirejs.config({paths});\n",
              "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
              "    } else {\n",
              "      maybeLoadScript(\"vega\", \"5\")\n",
              "        .then(() => maybeLoadScript(\"vega-lite\", \"5.17.0\"))\n",
              "        .then(() => maybeLoadScript(\"vega-embed\", \"6\"))\n",
              "        .catch(showError)\n",
              "        .then(() => displayChart(vegaEmbed));\n",
              "    }\n",
              "  })({\"config\": {\"view\": {\"continuousWidth\": 300, \"continuousHeight\": 300, \"discreteHeight\": 60, \"discreteWidth\": 400}, \"header\": {\"title\": null}, \"mark\": {\"tooltip\": null}, \"title\": {\"anchor\": \"middle\"}}, \"vconcat\": [{\"mark\": {\"type\": \"bar\", \"clip\": true, \"height\": 15}, \"encoding\": {\"color\": {\"field\": \"log2_bayes_factor\", \"scale\": {\"domain\": [-10, 0, 10], \"interpolate\": \"lab\", \"range\": [\"red\", \"#bbbbbb\", \"green\"]}, \"title\": \"Match weight\", \"type\": \"quantitative\"}, \"tooltip\": [{\"field\": \"comparison_name\", \"title\": \"Comparison name\", \"type\": \"nominal\"}, {\"field\": \"probability_two_random_records_match\", \"format\": \".4f\", \"title\": \"Probability two random records match\", \"type\": \"nominal\"}, {\"field\": \"log2_bayes_factor\", \"format\": \",.4f\", \"title\": \"Equivalent match weight\", \"type\": \"quantitative\"}, {\"field\": \"bayes_factor_description\", \"title\": \"Match weight description\", \"type\": \"nominal\"}], \"x\": {\"axis\": {\"domain\": false, \"gridColor\": {\"condition\": {\"test\": \"abs(datum.value / 10)  <= 1 & datum.value % 10 === 0\", \"value\": \"#aaa\"}, \"value\": \"#ddd\"}, \"gridDash\": {\"condition\": {\"test\": \"abs(datum.value / 10) == 1\", \"value\": [3]}, \"value\": null}, \"gridWidth\": {\"condition\": {\"test\": \"abs(datum.value / 10)  <= 1 & datum.value % 10 === 0\", \"value\": 2}, \"value\": 1}, \"labels\": false, \"ticks\": false, \"title\": \"\"}, \"field\": \"log2_bayes_factor\", \"scale\": {\"domain\": [-9, 9]}, \"type\": \"quantitative\"}, \"y\": {\"axis\": {\"title\": \"Prior (starting) match weight\", \"titleAlign\": \"right\", \"titleAngle\": 0, \"titleFontWeight\": \"normal\"}, \"field\": \"label_for_charts\", \"sort\": {\"field\": \"comparison_vector_value\", \"order\": \"descending\"}, \"type\": \"nominal\"}}, \"height\": 20, \"transform\": [{\"filter\": \"(datum.comparison_name == 'probability_two_random_records_match')\"}]}, {\"mark\": {\"type\": \"bar\", \"clip\": true}, \"encoding\": {\"color\": {\"field\": \"log2_bayes_factor\", \"scale\": {\"domain\": [-10, 0, 10], \"interpolate\": \"lab\", \"range\": [\"red\", \"#bbbbbb\", \"green\"]}, \"title\": \"Match weight\", \"type\": \"quantitative\"}, \"row\": {\"field\": \"comparison_name\", \"header\": {\"labelAlign\": \"left\", \"labelAnchor\": \"middle\", \"labelAngle\": 0}, \"sort\": {\"field\": \"comparison_sort_order\"}, \"type\": \"nominal\"}, \"tooltip\": [{\"field\": \"comparison_name\", \"title\": \"Comparison name\", \"type\": \"nominal\"}, {\"field\": \"label_for_charts\", \"title\": \"Label\", \"type\": \"ordinal\"}, {\"field\": \"sql_condition\", \"title\": \"SQL condition\", \"type\": \"nominal\"}, {\"field\": \"m_probability\", \"format\": \".4f\", \"title\": \"M probability\", \"type\": \"quantitative\"}, {\"field\": \"u_probability\", \"format\": \".4f\", \"title\": \"U probability\", \"type\": \"quantitative\"}, {\"field\": \"bayes_factor\", \"format\": \",.4f\", \"title\": \"Bayes factor = m/u\", \"type\": \"quantitative\"}, {\"field\": \"log2_bayes_factor\", \"format\": \",.4f\", \"title\": \"Match weight = log2(m/u)\", \"type\": \"quantitative\"}, {\"field\": \"bayes_factor_description\", \"title\": \"Match weight description\", \"type\": \"nominal\"}], \"x\": {\"axis\": {\"gridColor\": {\"condition\": {\"test\": \"abs(datum.value / 10)  <= 1 & datum.value % 10 === 0\", \"value\": \"#aaa\"}, \"value\": \"#ddd\"}, \"gridDash\": {\"condition\": {\"test\": \"abs(datum.value / 10) == 1\", \"value\": [3]}, \"value\": null}, \"gridWidth\": {\"condition\": {\"test\": \"abs(datum.value / 10)  <= 1 & datum.value % 10 === 0\", \"value\": 2}, \"value\": 1}, \"title\": \"Comparison level match weight = log2(m/u)\"}, \"field\": \"log2_bayes_factor\", \"scale\": {\"domain\": [-9, 9]}, \"type\": \"quantitative\"}, \"y\": {\"axis\": {\"title\": null}, \"field\": \"label_for_charts\", \"sort\": {\"field\": \"comparison_vector_value\", \"order\": \"descending\"}, \"type\": \"nominal\"}}, \"height\": {\"step\": 12}, \"resolve\": {\"axis\": {\"y\": \"independent\"}, \"scale\": {\"y\": \"independent\"}}, \"transform\": [{\"filter\": \"(datum.comparison_name != 'probability_two_random_records_match')\"}]}], \"data\": {\"name\": \"data-22a98146eaf42dfc72375c62978cb78d\"}, \"params\": [{\"name\": \"mouse_zoom\", \"select\": {\"type\": \"interval\", \"encodings\": [\"x\"]}, \"bind\": \"scales\", \"views\": []}], \"resolve\": {\"axis\": {\"y\": \"independent\"}, \"scale\": {\"y\": \"independent\"}}, \"title\": {\"text\": \"Model parameters (components of final match weight)\", \"subtitle\": \"Use mousewheel to zoom\"}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v5.9.3.json\", \"datasets\": {\"data-22a98146eaf42dfc72375c62978cb78d\": [{\"comparison_name\": \"probability_two_random_records_match\", \"sql_condition\": null, \"label_for_charts\": \"\", \"m_probability\": null, \"u_probability\": null, \"m_probability_description\": null, \"u_probability_description\": null, \"has_tf_adjustments\": false, \"tf_adjustment_column\": null, \"tf_adjustment_weight\": null, \"is_null_level\": false, \"bayes_factor\": 0.023816582302252427, \"log2_bayes_factor\": -5.391889789559854, \"comparison_vector_value\": 0, \"max_comparison_vector_value\": 0, \"bayes_factor_description\": \"The probability that two random records drawn at random match is 0.023 or one in  43.0 records.This is equivalent to a starting match weight of -5.392.\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": -1}, {\"comparison_name\": \"first_name\", \"sql_condition\": \"first_name_l = first_name_r\", \"label_for_charts\": \"exact_match\", \"m_probability\": 0.5073501669215337, \"u_probability\": 0.0057935713975033705, \"m_probability_description\": \"Amongst matching record comparisons, 50.74% of records are in the exact_match comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 0.58% of records are in the exact_match comparison level\", \"has_tf_adjustments\": true, \"tf_adjustment_column\": \"first_name\", \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 87.57122888658395, \"log2_bayes_factor\": 6.452385051922501, \"comparison_vector_value\": 2, \"max_comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 87.57 times more likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 0}, {\"comparison_name\": \"first_name\", \"sql_condition\": \"levenshtein(first_name_l, first_name_r) <= 2\", \"label_for_charts\": \"Levenstein <= 2\", \"m_probability\": 0.27736434159157797, \"u_probability\": 0.010119901990634016, \"m_probability_description\": \"Amongst matching record comparisons, 27.74% of records are in the levenstein <= 2 comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 1.01% of records are in the levenstein <= 2 comparison level\", \"has_tf_adjustments\": false, \"tf_adjustment_column\": null, \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 27.407809072486973, \"log2_bayes_factor\": 4.776515101395072, \"comparison_vector_value\": 1, \"max_comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 27.41 times more likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 0}, {\"comparison_name\": \"first_name\", \"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.21528549148688833, \"u_probability\": 0.9840865266118626, \"m_probability_description\": \"Amongst matching record comparisons, 21.53% of records are in the all other comparisons comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 98.41% of records are in the all other comparisons comparison level\", \"has_tf_adjustments\": false, \"tf_adjustment_column\": null, \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 0.21876683164040506, \"log2_bayes_factor\": -2.1925340745596764, \"comparison_vector_value\": 0, \"max_comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.57 times less likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 0}, {\"comparison_name\": \"surname\", \"sql_condition\": \"surname_l = surname_r\", \"label_for_charts\": \"exact_match\", \"m_probability\": 0.4517645215191846, \"u_probability\": 0.004889975550122249, \"m_probability_description\": \"Amongst matching record comparisons, 45.18% of records are in the exact_match comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 0.49% of records are in the exact_match comparison level\", \"has_tf_adjustments\": true, \"tf_adjustment_column\": \"surname\", \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 92.38584465067325, \"log2_bayes_factor\": 6.529599913880287, \"comparison_vector_value\": 2, \"max_comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 92.39 times more likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 1}, {\"comparison_name\": \"surname\", \"sql_condition\": \"levenshtein(surname_l, surname_r) <= 2\", \"label_for_charts\": \"Levenstein <= 2\", \"m_probability\": 0.3078165102205689, \"u_probability\": 0.007373772654946249, \"m_probability_description\": \"Amongst matching record comparisons, 30.78% of records are in the levenstein <= 2 comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 0.74% of records are in the levenstein <= 2 comparison level\", \"has_tf_adjustments\": false, \"tf_adjustment_column\": null, \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 41.74477904659683, \"log2_bayes_factor\": 5.383523868172574, \"comparison_vector_value\": 1, \"max_comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 41.74 times more likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 1}, {\"comparison_name\": \"surname\", \"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.24041896826024636, \"u_probability\": 0.9877362517949315, \"m_probability_description\": \"Amongst matching record comparisons, 24.04% of records are in the all other comparisons comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 98.77% of records are in the all other comparisons comparison level\", \"has_tf_adjustments\": false, \"tf_adjustment_column\": null, \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 0.24340401379756268, \"log2_bayes_factor\": -2.03857513621085, \"comparison_vector_value\": 0, \"max_comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.11 times less likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 1}, {\"comparison_name\": \"dob\", \"sql_condition\": \"dob_l = dob_r\", \"label_for_charts\": \"exact_match\", \"m_probability\": 0.405530771330678, \"u_probability\": 0.0017477477477477479, \"m_probability_description\": \"Amongst matching record comparisons, 40.55% of records are in the exact_match comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 0.17% of records are in the exact_match comparison level\", \"has_tf_adjustments\": true, \"tf_adjustment_column\": \"dob\", \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 232.03049287476935, \"log2_bayes_factor\": 7.858170603008739, \"comparison_vector_value\": 2, \"max_comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 232.03 times more likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 2}, {\"comparison_name\": \"dob\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"label_for_charts\": \"Levenstein <= 2\", \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"m_probability_description\": \"Amongst matching record comparisons, 36.79% of records are in the levenstein <= 2 comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 1.71% of records are in the levenstein <= 2 comparison level\", \"has_tf_adjustments\": false, \"tf_adjustment_column\": null, \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 21.492671620753597, \"log2_bayes_factor\": 4.425772921275592, \"comparison_vector_value\": 1, \"max_comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 2}, {\"comparison_name\": \"dob\", \"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.22653362300553073, \"u_probability\": 0.9811331331331331, \"m_probability_description\": \"Amongst matching record comparisons, 22.65% of records are in the all other comparisons comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 98.11% of records are in the all other comparisons comparison level\", \"has_tf_adjustments\": false, \"tf_adjustment_column\": null, \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 0.23088978993311773, \"log2_bayes_factor\": -2.114723717091652, \"comparison_vector_value\": 0, \"max_comparison_vector_value\": 2, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.33 times less likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 2}, {\"comparison_name\": \"city\", \"sql_condition\": \"city_l = city_r\", \"label_for_charts\": \"exact_match\", \"m_probability\": 0.5782144900964232, \"u_probability\": 0.0551475711801453, \"m_probability_description\": \"Amongst matching record comparisons, 57.82% of records are in the exact_match comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 5.51% of records are in the exact_match comparison level\", \"has_tf_adjustments\": true, \"tf_adjustment_column\": \"city\", \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 10.484858675056154, \"log2_bayes_factor\": 3.3902355104306197, \"comparison_vector_value\": 1, \"max_comparison_vector_value\": 1, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 10.48 times more likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 3}, {\"comparison_name\": \"city\", \"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.4217855099035769, \"u_probability\": 0.9448524288198547, \"m_probability_description\": \"Amongst matching record comparisons, 42.18% of records are in the all other comparisons comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 94.49% of records are in the all other comparisons comparison level\", \"has_tf_adjustments\": false, \"tf_adjustment_column\": null, \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 0.4464035832880252, \"log2_bayes_factor\": -1.1635794871398053, \"comparison_vector_value\": 0, \"max_comparison_vector_value\": 1, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.24 times less likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 3}, {\"comparison_name\": \"email\", \"sql_condition\": \"email_l = email_r\", \"label_for_charts\": \"exact_match\", \"m_probability\": 0.5774909200578013, \"u_probability\": 0.0021938713143283602, \"m_probability_description\": \"Amongst matching record comparisons, 57.75% of records are in the exact_match comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 0.22% of records are in the exact_match comparison level\", \"has_tf_adjustments\": true, \"tf_adjustment_column\": \"email\", \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 263.2291676754963, \"log2_bayes_factor\": 8.04017554864013, \"comparison_vector_value\": 1, \"max_comparison_vector_value\": 1, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 263.23 times more likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 4}, {\"comparison_name\": \"email\", \"sql_condition\": \"ELSE\", \"label_for_charts\": \"All other comparisons\", \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"m_probability_description\": \"Amongst matching record comparisons, 42.25% of records are in the all other comparisons comparison level\", \"u_probability_description\": \"Amongst non-matching record comparisons, 99.78% of records are in the all other comparisons comparison level\", \"has_tf_adjustments\": false, \"tf_adjustment_column\": null, \"tf_adjustment_weight\": 1.0, \"is_null_level\": false, \"bayes_factor\": 0.4234380485302649, \"log2_bayes_factor\": -1.239777184635766, \"comparison_vector_value\": 0, \"max_comparison_vector_value\": 1, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"probability_two_random_records_match\": 0.02326254791526835, \"comparison_sort_order\": 4}]}}, {\"mode\": \"vega-lite\"});\n",
              "</script>"
            ],
            "text/plain": [
              "alt.VConcatChart(...)"
            ]
          },
          "execution_count": 8,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "linker.visualisations.match_weights_chart()"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": ".venv",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.10.8"
    },
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "state": {
          "04ba5b27fff046cdbcff86aeb938daf6": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "first_name",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_5d4a7365a34746fe9ed2319c19ad0d58",
              "placeholder": "​",
              "style": "IPY_MODEL_2fe5902f30274f95a26e4c0897b2a011",
              "tabbable": null,
              "tooltip": null,
              "value": "Lucas"
            }
          },
          "086fdaefbddf4915be8385c98d46c358": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "unique_id",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_658f48614d3d4c63bbdc946d44b9f734",
              "placeholder": "​",
              "style": "IPY_MODEL_80683606961c4187965cc00e4944fbe1",
              "tabbable": null,
              "tooltip": null,
              "value": "2"
            }
          },
          "0908dba9a7fa4e22b818b1bb31bd415a": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "11bbe083b862406d814c35e47d773ade": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "1b024ddb36284e4b85b5054092f531bc": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "1fa9c4a8c62846f591a1fb4e4d91d3ed": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "dob",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_cb0b167a052745fd9204729f961b7ad6",
              "placeholder": "​",
              "style": "IPY_MODEL_ca1c754b37a640a69908cb2b34cb7b3c",
              "tabbable": null,
              "tooltip": null,
              "value": "1984-01-02"
            }
          },
          "2191036959a444558a7e6663f51f60d4": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "21ae049d073b458b902a65f9d4b1e0f1": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "HBoxModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "HBoxModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "HBoxView",
              "box_style": "",
              "children": [
                "IPY_MODEL_968249064f3446ee806ef5e750085fe4",
                "IPY_MODEL_272d325448674ae4882758a7af3d6354"
              ],
              "layout": "IPY_MODEL_ecb562219597492fae7b4bf881ea113f",
              "tabbable": null,
              "tooltip": null
            }
          },
          "23d4adc30abf4b8c845e3a22a7929ada": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "24f94cd7e9f84e2098d97f75d6f01a8d": {
            "model_module": "@jupyter-widgets/output",
            "model_module_version": "1.0.0",
            "model_name": "OutputModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/output",
              "_model_module_version": "1.0.0",
              "_model_name": "OutputModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/output",
              "_view_module_version": "1.0.0",
              "_view_name": "OutputView",
              "layout": "IPY_MODEL_f3de223015854925895cbd794a7ee8c2",
              "msg_id": "",
              "outputs": [
                {
                  "data": {
                    "text/html": "\n<style>\n  #altair-viz-cc6204955dec4b38bee55c8d025fdc79.vega-embed {\n    width: 100%;\n    display: flex;\n  }\n\n  #altair-viz-cc6204955dec4b38bee55c8d025fdc79.vega-embed details,\n  #altair-viz-cc6204955dec4b38bee55c8d025fdc79.vega-embed details summary {\n    position: relative;\n  }\n</style>\n<div id=\"altair-viz-cc6204955dec4b38bee55c8d025fdc79\"></div>\n<script type=\"text/javascript\">\n  var VEGA_DEBUG = (typeof VEGA_DEBUG == \"undefined\") ? {} : VEGA_DEBUG;\n  (function(spec, embedOpt){\n    let outputDiv = document.currentScript.previousElementSibling;\n    if (outputDiv.id !== \"altair-viz-cc6204955dec4b38bee55c8d025fdc79\") {\n      outputDiv = document.getElementById(\"altair-viz-cc6204955dec4b38bee55c8d025fdc79\");\n    }\n    const paths = {\n      \"vega\": \"https://cdn.jsdelivr.net/npm/vega@5?noext\",\n      \"vega-lib\": \"https://cdn.jsdelivr.net/npm/vega-lib?noext\",\n      \"vega-lite\": \"https://cdn.jsdelivr.net/npm/vega-lite@5.17.0?noext\",\n      \"vega-embed\": \"https://cdn.jsdelivr.net/npm/vega-embed@6?noext\",\n    };\n\n    function maybeLoadScript(lib, version) {\n      var key = `${lib.replace(\"-\", \"\")}_version`;\n      return (VEGA_DEBUG[key] == version) ?\n        Promise.resolve(paths[lib]) :\n        new Promise(function(resolve, reject) {\n          var s = document.createElement('script');\n          document.getElementsByTagName(\"head\")[0].appendChild(s);\n          s.async = true;\n          s.onload = () => {\n            VEGA_DEBUG[key] = version;\n            return resolve(paths[lib]);\n          };\n          s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n          s.src = paths[lib];\n        });\n    }\n\n    function showError(err) {\n      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n      throw err;\n    }\n\n    function displayChart(vegaEmbed) {\n      vegaEmbed(outputDiv, spec, embedOpt)\n        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n    }\n\n    if(typeof define === \"function\" && define.amd) {\n      requirejs.config({paths});\n      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n    } else {\n      maybeLoadScript(\"vega\", \"5\")\n        .then(() => maybeLoadScript(\"vega-lite\", \"5.17.0\"))\n        .then(() => maybeLoadScript(\"vega-embed\", \"6\"))\n        .catch(showError)\n        .then(() => displayChart(vegaEmbed));\n    }\n  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"layer\": [{\"layer\": [{\"mark\": \"rule\", \"encoding\": {\"color\": {\"value\": \"black\"}, \"size\": {\"value\": 0.5}, \"y\": {\"field\": \"zero\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"bar\", \"width\": 60}, \"encoding\": {\"color\": {\"condition\": {\"test\": \"(datum.log2_bayes_factor < 0)\", \"value\": \"red\"}, \"value\": \"green\"}, \"opacity\": {\"condition\": {\"test\": \"datum.column_name == 'Prior match weight' || datum.column_name == 'Final score'\", \"value\": 1}, \"value\": 0.5}, \"tooltip\": [{\"field\": \"column_name\", \"title\": \"Comparison column\", \"type\": \"nominal\"}, {\"field\": \"value_l\", \"title\": \"Value (L)\", \"type\": \"nominal\"}, {\"field\": \"value_r\", \"title\": \"Value (R)\", \"type\": \"nominal\"}, {\"field\": \"label_for_charts\", \"title\": \"Label\", \"type\": \"ordinal\"}, {\"field\": \"sql_condition\", \"title\": \"SQL condition\", \"type\": \"nominal\"}, {\"field\": \"comparison_vector_value\", \"title\": \"Comparison vector value\", \"type\": \"nominal\"}, {\"field\": \"bayes_factor\", \"format\": \",.4f\", \"title\": \"Bayes factor = m/u\", \"type\": \"quantitative\"}, {\"field\": \"log2_bayes_factor\", \"format\": \",.4f\", \"title\": \"Match weight = log2(m/u)\", \"type\": \"quantitative\"}, {\"field\": \"prob\", \"format\": \".4f\", \"title\": \"Cumulative match probability\", \"type\": \"quantitative\"}, {\"field\": \"bayes_factor_description\", \"title\": \"Match weight description\", \"type\": \"nominal\"}], \"x\": {\"axis\": {\"grid\": true, \"labelAlign\": \"center\", \"labelAngle\": -20, \"labelExpr\": \"datum.value == 'Prior' || datum.value == 'Final score' ? '' : datum.value\", \"labelPadding\": 10, \"tickBand\": \"extent\", \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"axis\": {\"grid\": false, \"orient\": \"left\", \"title\": \"Match Weight\"}, \"field\": \"previous_sum\", \"type\": \"quantitative\"}, \"y2\": {\"field\": \"sum\"}}}, {\"mark\": {\"type\": \"text\", \"fontWeight\": \"bold\"}, \"encoding\": {\"color\": {\"value\": \"white\"}, \"text\": {\"condition\": {\"test\": \"abs(datum.log2_bayes_factor) > 1\", \"field\": \"log2_bayes_factor\", \"format\": \".2f\", \"type\": \"nominal\"}, \"value\": \"\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"axis\": {\"orient\": \"left\"}, \"field\": \"center\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"text\", \"baseline\": \"bottom\", \"dy\": -25, \"fontWeight\": \"bold\"}, \"encoding\": {\"color\": {\"value\": \"black\"}, \"text\": {\"field\": \"column_name\", \"type\": \"nominal\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"field\": \"sum_top\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"text\", \"baseline\": \"bottom\", \"dy\": -13, \"fontSize\": 8}, \"encoding\": {\"color\": {\"value\": \"grey\"}, \"text\": {\"field\": \"value_l\", \"type\": \"nominal\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"field\": \"sum_top\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"text\", \"baseline\": \"bottom\", \"dy\": -5, \"fontSize\": 8}, \"encoding\": {\"color\": {\"value\": \"grey\"}, \"text\": {\"field\": \"value_r\", \"type\": \"nominal\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"field\": \"sum_top\", \"type\": \"quantitative\"}}}]}, {\"mark\": {\"type\": \"rule\", \"color\": \"black\", \"strokeWidth\": 2, \"x2Offset\": 30, \"xOffset\": -30}, \"encoding\": {\"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"x2\": {\"field\": \"lead\"}, \"y\": {\"axis\": {\"labelExpr\": \"format(1 / (1 + pow(2, -1*datum.value)), '.2r')\", \"orient\": \"right\", \"title\": \"Probability\"}, \"field\": \"sum\", \"scale\": {\"zero\": false}, \"type\": \"quantitative\"}}}], \"data\": {\"name\": \"data-4a0644265787d10c1c5cb7f8b4634461\"}, \"height\": 450, \"params\": [{\"name\": \"record_number\", \"bind\": {\"input\": \"range\", \"max\": 6, \"min\": 0, \"step\": 1}, \"value\": 0}], \"resolve\": {\"axis\": {\"y\": \"independent\"}}, \"title\": {\"text\": \"Match weights waterfall chart\", \"subtitle\": \"How each comparison contributes to the final match score\"}, \"transform\": [{\"filter\": \"(datum.record_number == record_number)\"}, {\"window\": [{\"op\": \"sum\", \"field\": \"log2_bayes_factor\", \"as\": \"sum\"}, {\"op\": \"lead\", \"field\": \"column_name\", \"as\": \"lead\"}], \"frame\": [null, 0]}, {\"calculate\": \"datum.column_name === \\\"Final score\\\" ? datum.sum - datum.log2_bayes_factor : datum.sum\", \"as\": \"sum\"}, {\"calculate\": \"datum.lead === null ? datum.column_name : datum.lead\", \"as\": \"lead\"}, {\"calculate\": \"datum.column_name === \\\"Final score\\\" || datum.column_name === \\\"Prior match weight\\\" ? 0 : datum.sum - datum.log2_bayes_factor\", \"as\": \"previous_sum\"}, {\"calculate\": \"datum.sum > datum.previous_sum ? datum.column_name : \\\"\\\"\", \"as\": \"top_label\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? datum.column_name : \\\"\\\"\", \"as\": \"bottom_label\"}, {\"calculate\": \"datum.sum > datum.previous_sum ? datum.sum : datum.previous_sum\", \"as\": \"sum_top\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? datum.sum : datum.previous_sum\", \"as\": \"sum_bottom\"}, {\"calculate\": \"(datum.sum + datum.previous_sum) / 2\", \"as\": \"center\"}, {\"calculate\": \"(datum.log2_bayes_factor > 0 ? \\\"+\\\" : \\\"\\\") + datum.log2_bayes_factor\", \"as\": \"text_log2_bayes_factor\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? 4 : -4\", \"as\": \"dy\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? \\\"top\\\" : \\\"bottom\\\"\", \"as\": \"baseline\"}, {\"calculate\": \"1. / (1 + pow(2, -1.*datum.sum))\", \"as\": \"prob\"}, {\"calculate\": \"0*datum.sum\", \"as\": \"zero\"}], \"width\": {\"step\": 75}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v5.9.3.json\", \"datasets\": {\"data-4a0644265787d10c1c5cb7f8b4634461\": [{\"column_name\": \"Prior\", \"label_for_charts\": \"Starting match weight (prior)\", \"sql_condition\": null, \"log2_bayes_factor\": -5.391889789559854, \"bayes_factor\": 0.023816582302252427, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 0, \"record_number\": 0}, {\"column_name\": \"first_name\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"first_name_l = first_name_r\", \"log2_bayes_factor\": 6.452385051922501, \"bayes_factor\": 87.57122888658395, \"comparison_vector_value\": 2, \"m_probability\": 0.5073501669215337, \"u_probability\": 0.0057935713975033705, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 87.57 times more likely to be a match\", \"value_l\": \"Robert\", \"value_r\": \"Robert\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 1, \"record_number\": 0}, {\"column_name\": \"tf_first_name\", \"label_for_charts\": \"Term freq adjustment on first_name with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"first_name_l = first_name_r\", \"log2_bayes_factor\": 0.6824108408369749, \"bayes_factor\": 1.6048192771084335, \"comparison_vector_value\": 2, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on first_name makes comparison 1.60 times more likely to be a match\", \"value_l\": \"Robert\", \"value_r\": \"Robert\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 2, \"record_number\": 0}, {\"column_name\": \"surname\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"surname_l = surname_r\", \"log2_bayes_factor\": 6.529599913880287, \"bayes_factor\": 92.38584465067325, \"comparison_vector_value\": 2, \"m_probability\": 0.4517645215191846, \"u_probability\": 0.004889975550122249, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 92.39 times more likely to be a match\", \"value_l\": \"Alan\", \"value_r\": \"Alan\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 3, \"record_number\": 0}, {\"column_name\": \"tf_surname\", \"label_for_charts\": \"Term freq adjustment on surname with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"surname_l = surname_r\", \"log2_bayes_factor\": 2.0017626086992597, \"bayes_factor\": 4.004889975550122, \"comparison_vector_value\": 2, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on surname makes comparison 4.00 times more likely to be a match\", \"value_l\": \"Alan\", \"value_r\": \"Alan\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 4, \"record_number\": 0}, {\"column_name\": \"dob\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"log2_bayes_factor\": 4.425772921275592, \"bayes_factor\": 21.492671620753597, \"comparison_vector_value\": 1, \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"value_l\": \"1971-06-24\", \"value_r\": \"1971-05-24\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 5, \"record_number\": 0}, {\"column_name\": \"tf_dob\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 1, \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 6, \"record_number\": 0}, {\"column_name\": \"city\", \"label_for_charts\": \"Null\", \"sql_condition\": \"city_l IS NULL OR city_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"None\", \"value_r\": \"London\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 7, \"record_number\": 0}, {\"column_name\": \"tf_city\", \"label_for_charts\": \"Null\", \"sql_condition\": \"city_l IS NULL OR city_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 8, \"record_number\": 0}, {\"column_name\": \"email\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"email_l = email_r\", \"log2_bayes_factor\": 8.04017554864013, \"bayes_factor\": 263.2291676754963, \"comparison_vector_value\": 1, \"m_probability\": 0.5774909200578013, \"u_probability\": 0.0021938713143283602, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 263.23 times more likely to be a match\", \"value_l\": \"robert255@smith.net\", \"value_r\": \"robert255@smith.net\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 9, \"record_number\": 0}, {\"column_name\": \"tf_email\", \"label_for_charts\": \"Term freq adjustment on email with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"email_l = email_r\", \"log2_bayes_factor\": 0.791576109567796, \"bayes_factor\": 1.730964467005076, \"comparison_vector_value\": 1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on email makes comparison 1.73 times more likely to be a match\", \"value_l\": \"robert255@smith.net\", \"value_r\": \"robert255@smith.net\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 10, \"record_number\": 0}, {\"column_name\": \"Final score\", \"label_for_charts\": \"Final score\", \"sql_condition\": null, \"log2_bayes_factor\": 23.531793205262687, \"bayes_factor\": 12127620.72557027, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 11, \"record_number\": 0}, {\"column_name\": \"Prior\", \"label_for_charts\": \"Starting match weight (prior)\", \"sql_condition\": null, \"log2_bayes_factor\": -5.391889789559854, \"bayes_factor\": 0.023816582302252427, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 0, \"record_number\": 1}, {\"column_name\": \"first_name\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"first_name_l = first_name_r\", \"log2_bayes_factor\": 6.452385051922501, \"bayes_factor\": 87.57122888658395, \"comparison_vector_value\": 2, \"m_probability\": 0.5073501669215337, \"u_probability\": 0.0057935713975033705, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 87.57 times more likely to be a match\", \"value_l\": \"Robert\", \"value_r\": \"Robert\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 1, \"record_number\": 1}, {\"column_name\": \"tf_first_name\", \"label_for_charts\": \"Term freq adjustment on first_name with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"first_name_l = first_name_r\", \"log2_bayes_factor\": 0.6824108408369749, \"bayes_factor\": 1.6048192771084335, \"comparison_vector_value\": 2, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on first_name makes comparison 1.60 times more likely to be a match\", \"value_l\": \"Robert\", \"value_r\": \"Robert\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 2, \"record_number\": 1}, {\"column_name\": \"surname\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(surname_l, surname_r) <= 2\", \"log2_bayes_factor\": 5.383523868172574, \"bayes_factor\": 41.74477904659683, \"comparison_vector_value\": 1, \"m_probability\": 0.3078165102205689, \"u_probability\": 0.007373772654946249, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 41.74 times more likely to be a match\", \"value_l\": \"Allen\", \"value_r\": \"Alan\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 3, \"record_number\": 1}, {\"column_name\": \"tf_surname\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(surname_l, surname_r) <= 2\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 1, \"m_probability\": 0.3078165102205689, \"u_probability\": 0.007373772654946249, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 41.74 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 4, \"record_number\": 1}, {\"column_name\": \"dob\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"dob_l = dob_r\", \"log2_bayes_factor\": 7.858170603008739, \"bayes_factor\": 232.03049287476935, \"comparison_vector_value\": 2, \"m_probability\": 0.405530771330678, \"u_probability\": 0.0017477477477477479, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 232.03 times more likely to be a match\", \"value_l\": \"1971-05-24\", \"value_r\": \"1971-05-24\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 5, \"record_number\": 1}, {\"column_name\": \"tf_dob\", \"label_for_charts\": \"Term freq adjustment on dob with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"dob_l = dob_r\", \"log2_bayes_factor\": 0.805496975837022, \"bayes_factor\": 1.747747747747748, \"comparison_vector_value\": 2, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on dob makes comparison 1.75 times more likely to be a match\", \"value_l\": \"1971-05-24\", \"value_r\": \"1971-05-24\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 6, \"record_number\": 1}, {\"column_name\": \"city\", \"label_for_charts\": \"Null\", \"sql_condition\": \"city_l IS NULL OR city_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"None\", \"value_r\": \"London\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 7, \"record_number\": 1}, {\"column_name\": \"tf_city\", \"label_for_charts\": \"Null\", \"sql_condition\": \"city_l IS NULL OR city_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 8, \"record_number\": 1}, {\"column_name\": \"email\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": -1.239777184635766, \"bayes_factor\": 0.4234380485302649, \"comparison_vector_value\": 0, \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"value_l\": \"roberta25@smith.net\", \"value_r\": \"robert255@smith.net\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 9, \"record_number\": 1}, {\"column_name\": \"tf_email\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 0, \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 10, \"record_number\": 1}, {\"column_name\": \"Final score\", \"label_for_charts\": \"Final score\", \"sql_condition\": null, \"log2_bayes_factor\": 14.550320365582191, \"bayes_factor\": 23992.90732786014, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 11, \"record_number\": 1}, {\"column_name\": \"Prior\", \"label_for_charts\": \"Starting match weight (prior)\", \"sql_condition\": null, \"log2_bayes_factor\": -5.391889789559854, \"bayes_factor\": 0.023816582302252427, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 0, \"record_number\": 2}, {\"column_name\": \"first_name\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"first_name_l = first_name_r\", \"log2_bayes_factor\": 6.452385051922501, \"bayes_factor\": 87.57122888658395, \"comparison_vector_value\": 2, \"m_probability\": 0.5073501669215337, \"u_probability\": 0.0057935713975033705, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 87.57 times more likely to be a match\", \"value_l\": \"Robert\", \"value_r\": \"Robert\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 1, \"record_number\": 2}, {\"column_name\": \"tf_first_name\", \"label_for_charts\": \"Term freq adjustment on first_name with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"first_name_l = first_name_r\", \"log2_bayes_factor\": 0.6824108408369749, \"bayes_factor\": 1.6048192771084335, \"comparison_vector_value\": 2, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on first_name makes comparison 1.60 times more likely to be a match\", \"value_l\": \"Robert\", \"value_r\": \"Robert\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 2, \"record_number\": 2}, {\"column_name\": \"surname\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(surname_l, surname_r) <= 2\", \"log2_bayes_factor\": 5.383523868172574, \"bayes_factor\": 41.74477904659683, \"comparison_vector_value\": 1, \"m_probability\": 0.3078165102205689, \"u_probability\": 0.007373772654946249, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 41.74 times more likely to be a match\", \"value_l\": \"Alen\", \"value_r\": \"Alan\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 3, \"record_number\": 2}, {\"column_name\": \"tf_surname\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(surname_l, surname_r) <= 2\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 1, \"m_probability\": 0.3078165102205689, \"u_probability\": 0.007373772654946249, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 41.74 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 4, \"record_number\": 2}, {\"column_name\": \"dob\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"log2_bayes_factor\": 4.425772921275592, \"bayes_factor\": 21.492671620753597, \"comparison_vector_value\": 1, \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"value_l\": \"1971-06-24\", \"value_r\": \"1971-05-24\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 5, \"record_number\": 2}, {\"column_name\": \"tf_dob\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 1, \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 6, \"record_number\": 2}, {\"column_name\": \"city\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": -1.1635794871398053, \"bayes_factor\": 0.4464035832880252, \"comparison_vector_value\": 0, \"m_probability\": 0.4217855099035769, \"u_probability\": 0.9448524288198547, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.24 times less likely to be a match\", \"value_l\": \"Lonon\", \"value_r\": \"London\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 7, \"record_number\": 2}, {\"column_name\": \"tf_city\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 0, \"m_probability\": 0.4217855099035769, \"u_probability\": 0.9448524288198547, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.24 times less likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 8, \"record_number\": 2}, {\"column_name\": \"email\", \"label_for_charts\": \"Null\", \"sql_condition\": \"email_l IS NULL OR email_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"None\", \"value_r\": \"robert255@smith.net\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 9, \"record_number\": 2}, {\"column_name\": \"tf_email\", \"label_for_charts\": \"Null\", \"sql_condition\": \"email_l IS NULL OR email_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 10, \"record_number\": 2}, {\"column_name\": \"Final score\", \"label_for_charts\": \"Final score\", \"sql_condition\": null, \"log2_bayes_factor\": 10.388623405507984, \"bayes_factor\": 1340.5630931238354, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 11, \"record_number\": 2}, {\"column_name\": \"Prior\", \"label_for_charts\": \"Starting match weight (prior)\", \"sql_condition\": null, \"log2_bayes_factor\": -5.391889789559854, \"bayes_factor\": 0.023816582302252427, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 0, \"record_number\": 3}, {\"column_name\": \"first_name\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": -2.1925340745596764, \"bayes_factor\": 0.21876683164040506, \"comparison_vector_value\": 0, \"m_probability\": 0.21528549148688833, \"u_probability\": 0.9840865266118626, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.57 times less likely to be a match\", \"value_l\": \"Rob\", \"value_r\": \"Robert\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 1, \"record_number\": 3}, {\"column_name\": \"tf_first_name\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 0, \"m_probability\": 0.21528549148688833, \"u_probability\": 0.9840865266118626, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.57 times less likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 2, \"record_number\": 3}, {\"column_name\": \"surname\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(surname_l, surname_r) <= 2\", \"log2_bayes_factor\": 5.383523868172574, \"bayes_factor\": 41.74477904659683, \"comparison_vector_value\": 1, \"m_probability\": 0.3078165102205689, \"u_probability\": 0.007373772654946249, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 41.74 times more likely to be a match\", \"value_l\": \"Allen\", \"value_r\": \"Alan\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 3, \"record_number\": 3}, {\"column_name\": \"tf_surname\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(surname_l, surname_r) <= 2\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 1, \"m_probability\": 0.3078165102205689, \"u_probability\": 0.007373772654946249, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 41.74 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 4, \"record_number\": 3}, {\"column_name\": \"dob\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"log2_bayes_factor\": 4.425772921275592, \"bayes_factor\": 21.492671620753597, \"comparison_vector_value\": 1, \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"value_l\": \"1971-06-24\", \"value_r\": \"1971-05-24\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 5, \"record_number\": 3}, {\"column_name\": \"tf_dob\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 1, \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 6, \"record_number\": 3}, {\"column_name\": \"city\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"city_l = city_r\", \"log2_bayes_factor\": 3.3902355104306197, \"bayes_factor\": 10.484858675056154, \"comparison_vector_value\": 1, \"m_probability\": 0.5782144900964232, \"u_probability\": 0.0551475711801453, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 10.48 times more likely to be a match\", \"value_l\": \"London\", \"value_r\": \"London\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 7, \"record_number\": 3}, {\"column_name\": \"tf_city\", \"label_for_charts\": \"Term freq adjustment on city with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"city_l = city_r\", \"log2_bayes_factor\": -1.948075527570922, \"bayes_factor\": 0.2591617073379083, \"comparison_vector_value\": 1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on city makes comparison  3.86 times less likely to be a match\", \"value_l\": \"London\", \"value_r\": \"London\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 8, \"record_number\": 3}, {\"column_name\": \"email\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": -1.239777184635766, \"bayes_factor\": 0.4234380485302649, \"comparison_vector_value\": 0, \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"value_l\": \"roberta25@smith.net\", \"value_r\": \"robert255@smith.net\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 9, \"record_number\": 3}, {\"column_name\": \"tf_email\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 0, \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 10, \"record_number\": 3}, {\"column_name\": \"Final score\", \"label_for_charts\": \"Final score\", \"sql_condition\": null, \"log2_bayes_factor\": 2.427255723552568, \"bayes_factor\": 5.3786932873387086, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 11, \"record_number\": 3}, {\"column_name\": \"Prior\", \"label_for_charts\": \"Starting match weight (prior)\", \"sql_condition\": null, \"log2_bayes_factor\": -5.391889789559854, \"bayes_factor\": 0.023816582302252427, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 0, \"record_number\": 4}, {\"column_name\": \"first_name\", \"label_for_charts\": \"Null\", \"sql_condition\": \"first_name_l IS NULL OR first_name_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"None\", \"value_r\": \"Robert\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 1, \"record_number\": 4}, {\"column_name\": \"tf_first_name\", \"label_for_charts\": \"Null\", \"sql_condition\": \"first_name_l IS NULL OR first_name_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 2, \"record_number\": 4}, {\"column_name\": \"surname\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(surname_l, surname_r) <= 2\", \"log2_bayes_factor\": 5.383523868172574, \"bayes_factor\": 41.74477904659683, \"comparison_vector_value\": 1, \"m_probability\": 0.3078165102205689, \"u_probability\": 0.007373772654946249, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 41.74 times more likely to be a match\", \"value_l\": \"Dean\", \"value_r\": \"Alan\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 3, \"record_number\": 4}, {\"column_name\": \"tf_surname\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(surname_l, surname_r) <= 2\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 1, \"m_probability\": 0.3078165102205689, \"u_probability\": 0.007373772654946249, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 41.74 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 4, \"record_number\": 4}, {\"column_name\": \"dob\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": -2.114723717091652, \"bayes_factor\": 0.23088978993311773, \"comparison_vector_value\": 0, \"m_probability\": 0.22653362300553073, \"u_probability\": 0.9811331331331331, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.33 times less likely to be a match\", \"value_l\": \"2015-03-03\", \"value_r\": \"1971-05-24\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 5, \"record_number\": 4}, {\"column_name\": \"tf_dob\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 0, \"m_probability\": 0.22653362300553073, \"u_probability\": 0.9811331331331331, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.33 times less likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 6, \"record_number\": 4}, {\"column_name\": \"city\", \"label_for_charts\": \"Null\", \"sql_condition\": \"city_l IS NULL OR city_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"None\", \"value_r\": \"London\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 7, \"record_number\": 4}, {\"column_name\": \"tf_city\", \"label_for_charts\": \"Null\", \"sql_condition\": \"city_l IS NULL OR city_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 8, \"record_number\": 4}, {\"column_name\": \"email\", \"label_for_charts\": \"Null\", \"sql_condition\": \"email_l IS NULL OR email_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"None\", \"value_r\": \"robert255@smith.net\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 9, \"record_number\": 4}, {\"column_name\": \"tf_email\", \"label_for_charts\": \"Null\", \"sql_condition\": \"email_l IS NULL OR email_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 10, \"record_number\": 4}, {\"column_name\": \"Final score\", \"label_for_charts\": \"Final score\", \"sql_condition\": null, \"log2_bayes_factor\": -2.1230896384789317, \"bayes_factor\": 0.22955477728344212, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 11, \"record_number\": 4}, {\"column_name\": \"Prior\", \"label_for_charts\": \"Starting match weight (prior)\", \"sql_condition\": null, \"log2_bayes_factor\": -5.391889789559854, \"bayes_factor\": 0.023816582302252427, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 0, \"record_number\": 5}, {\"column_name\": \"first_name\", \"label_for_charts\": \"Null\", \"sql_condition\": \"first_name_l IS NULL OR first_name_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"None\", \"value_r\": \"Robert\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 1, \"record_number\": 5}, {\"column_name\": \"tf_first_name\", \"label_for_charts\": \"Null\", \"sql_condition\": \"first_name_l IS NULL OR first_name_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 2, \"record_number\": 5}, {\"column_name\": \"surname\", \"label_for_charts\": \"Null\", \"sql_condition\": \"surname_l IS NULL OR surname_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"None\", \"value_r\": \"Alan\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 3, \"record_number\": 5}, {\"column_name\": \"tf_surname\", \"label_for_charts\": \"Null\", \"sql_condition\": \"surname_l IS NULL OR surname_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 4, \"record_number\": 5}, {\"column_name\": \"dob\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"log2_bayes_factor\": 4.425772921275592, \"bayes_factor\": 21.492671620753597, \"comparison_vector_value\": 1, \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"value_l\": \"1971-07-20\", \"value_r\": \"1971-05-24\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 5, \"record_number\": 5}, {\"column_name\": \"tf_dob\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 1, \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 6, \"record_number\": 5}, {\"column_name\": \"city\", \"label_for_charts\": \"Null\", \"sql_condition\": \"city_l IS NULL OR city_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"None\", \"value_r\": \"London\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 7, \"record_number\": 5}, {\"column_name\": \"tf_city\", \"label_for_charts\": \"Null\", \"sql_condition\": \"city_l IS NULL OR city_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 8, \"record_number\": 5}, {\"column_name\": \"email\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": -1.239777184635766, \"bayes_factor\": 0.4234380485302649, \"comparison_vector_value\": 0, \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"value_l\": \"j.c@whige.wort\", \"value_r\": \"robert255@smith.net\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 9, \"record_number\": 5}, {\"column_name\": \"tf_email\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 0, \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 10, \"record_number\": 5}, {\"column_name\": \"Final score\", \"label_for_charts\": \"Final score\", \"sql_condition\": null, \"log2_bayes_factor\": -2.2058940529200273, \"bayes_factor\": 0.21675030776918294, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 11, \"record_number\": 5}, {\"column_name\": \"Prior\", \"label_for_charts\": \"Starting match weight (prior)\", \"sql_condition\": null, \"log2_bayes_factor\": -5.391889789559854, \"bayes_factor\": 0.023816582302252427, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 0, \"record_number\": 6}, {\"column_name\": \"first_name\", \"label_for_charts\": \"Null\", \"sql_condition\": \"first_name_l IS NULL OR first_name_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"None\", \"value_r\": \"Robert\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 1, \"record_number\": 6}, {\"column_name\": \"tf_first_name\", \"label_for_charts\": \"Null\", \"sql_condition\": \"first_name_l IS NULL OR first_name_r IS NULL\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": -1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"If comparison level is `null` then comparison is 1.00 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 2, \"record_number\": 6}, {\"column_name\": \"surname\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": -2.03857513621085, \"bayes_factor\": 0.24340401379756268, \"comparison_vector_value\": 0, \"m_probability\": 0.24041896826024636, \"u_probability\": 0.9877362517949315, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.11 times less likely to be a match\", \"value_l\": \"Cox\", \"value_r\": \"Alan\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 3, \"record_number\": 6}, {\"column_name\": \"tf_surname\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 0, \"m_probability\": 0.24041896826024636, \"u_probability\": 0.9877362517949315, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.11 times less likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 4, \"record_number\": 6}, {\"column_name\": \"dob\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"log2_bayes_factor\": 4.425772921275592, \"bayes_factor\": 21.492671620753597, \"comparison_vector_value\": 1, \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"value_l\": \"1971-07-20\", \"value_r\": \"1971-05-24\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 5, \"record_number\": 6}, {\"column_name\": \"tf_dob\", \"label_for_charts\": \"Levenstein <= 2\", \"sql_condition\": \"levenshtein(dob_l, dob_r) <= 2\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 1, \"m_probability\": 0.3679356056637918, \"u_probability\": 0.01711911911911912, \"bayes_factor_description\": \"If comparison level is `levenstein <= 2` then comparison is 21.49 times more likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 6, \"record_number\": 6}, {\"column_name\": \"city\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"city_l = city_r\", \"log2_bayes_factor\": 3.3902355104306197, \"bayes_factor\": 10.484858675056154, \"comparison_vector_value\": 1, \"m_probability\": 0.5782144900964232, \"u_probability\": 0.0551475711801453, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 10.48 times more likely to be a match\", \"value_l\": \"London\", \"value_r\": \"London\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 7, \"record_number\": 6}, {\"column_name\": \"tf_city\", \"label_for_charts\": \"Term freq adjustment on city with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"city_l = city_r\", \"log2_bayes_factor\": -1.948075527570922, \"bayes_factor\": 0.2591617073379083, \"comparison_vector_value\": 1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on city makes comparison  3.86 times less likely to be a match\", \"value_l\": \"London\", \"value_r\": \"London\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 8, \"record_number\": 6}, {\"column_name\": \"email\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": -1.239777184635766, \"bayes_factor\": 0.4234380485302649, \"comparison_vector_value\": 0, \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"value_l\": \"j.c@white.org\", \"value_r\": \"robert255@smith.net\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 9, \"record_number\": 6}, {\"column_name\": \"tf_email\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 0, \"m_probability\": 0.42250907994219916, \"u_probability\": 0.9978061286856716, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.36 times less likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 10, \"record_number\": 6}, {\"column_name\": \"Final score\", \"label_for_charts\": \"Final score\", \"sql_condition\": null, \"log2_bayes_factor\": -2.80230920627118, \"bayes_factor\": 0.14335764954196265, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 11, \"record_number\": 6}]}}, {\"mode\": \"vega-lite\"});\n</script>",
                    "text/plain": "alt.LayerChart(...)"
                  },
                  "metadata": {},
                  "output_type": "display_data"
                }
              ],
              "tabbable": null,
              "tooltip": null
            }
          },
          "250e8abe119446478ca7513778aed39a": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "272d325448674ae4882758a7af3d6354": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "VBoxModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "VBoxModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "VBoxView",
              "box_style": "",
              "children": [
                "IPY_MODEL_086fdaefbddf4915be8385c98d46c358",
                "IPY_MODEL_04ba5b27fff046cdbcff86aeb938daf6",
                "IPY_MODEL_3ce34f18f65c440f94f803b75b882788",
                "IPY_MODEL_4c51a67113a44ddfaff9108a85c37ec9",
                "IPY_MODEL_42f888b0586648a3b2cfc3394f083e26",
                "IPY_MODEL_c651dbf1a60b4f219d31355ec3d9d1cd"
              ],
              "layout": "IPY_MODEL_ffdf7e9a14d04f6b9a448df89e8ffbec",
              "tabbable": null,
              "tooltip": null
            }
          },
          "27e26efe54ab4971bbc5da3a355071b4": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "2a595765a0184d0db511726d83d67110": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "2fe5902f30274f95a26e4c0897b2a011": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "329729744d0c4e839c0503ab0259b18c": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "email",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_c71b8b6aa86343a7b0093f15313677f7",
              "placeholder": "​",
              "style": "IPY_MODEL_8456ddacbc5542c2a9d668d042a6abe6",
              "tabbable": null,
              "tooltip": null,
              "value": "lucas.smith@hotmail.com"
            }
          },
          "3b9b6f02a8f7491585ed99976548eb03": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "VBoxModel",
            "state": {
              "_dom_classes": [
                "widget-interact"
              ],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "VBoxModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "VBoxView",
              "box_style": "",
              "children": [
                "IPY_MODEL_73f2384489da4b748209c462724a3961",
                "IPY_MODEL_d27918510cb3494c930c545563fed3ca",
                "IPY_MODEL_b571fbb3f6a14611974779e927914d23",
                "IPY_MODEL_cc0ddc91bbfb4c6d891c202e279d4c74",
                "IPY_MODEL_b50d412867114f2eb000fc969b677c9c",
                "IPY_MODEL_24f94cd7e9f84e2098d97f75d6f01a8d"
              ],
              "layout": "IPY_MODEL_43db6d5bd49c46da8203977961927fed",
              "tabbable": null,
              "tooltip": null
            }
          },
          "3ce34f18f65c440f94f803b75b882788": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "surname",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_de296f36c45e4161a6c3d091dfea2892",
              "placeholder": "​",
              "style": "IPY_MODEL_a2c309f444944797824589147aede89d",
              "tabbable": null,
              "tooltip": null,
              "value": "Smith"
            }
          },
          "3e98708a97934bb095b2be73187fcec0": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "42f888b0586648a3b2cfc3394f083e26": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "email",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_2191036959a444558a7e6663f51f60d4",
              "placeholder": "​",
              "style": "IPY_MODEL_0908dba9a7fa4e22b818b1bb31bd415a",
              "tabbable": null,
              "tooltip": null,
              "value": "lucas.smith@hotmail.com"
            }
          },
          "43db6d5bd49c46da8203977961927fed": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "440256de4ff2405e95431f2fd9490436": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "4baf8bf6cf784f5ca98feee93978b3af": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "4c51a67113a44ddfaff9108a85c37ec9": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "dob",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_27e26efe54ab4971bbc5da3a355071b4",
              "placeholder": "​",
              "style": "IPY_MODEL_7c52d046223c4607b35759a148cc8515",
              "tabbable": null,
              "tooltip": null,
              "value": "1983-02-12"
            }
          },
          "4ccb8090b4a549829a1ac4a82a39ceac": {
            "model_module": "@jupyter-widgets/output",
            "model_module_version": "1.0.0",
            "model_name": "OutputModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/output",
              "_model_module_version": "1.0.0",
              "_model_name": "OutputModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/output",
              "_view_module_version": "1.0.0",
              "_view_name": "OutputView",
              "layout": "IPY_MODEL_2a595765a0184d0db511726d83d67110",
              "msg_id": "",
              "outputs": [
                {
                  "data": {
                    "text/html": "\n<style>\n  #altair-viz-b36eb15539894999ad2208e32ee63c31.vega-embed {\n    width: 100%;\n    display: flex;\n  }\n\n  #altair-viz-b36eb15539894999ad2208e32ee63c31.vega-embed details,\n  #altair-viz-b36eb15539894999ad2208e32ee63c31.vega-embed details summary {\n    position: relative;\n  }\n</style>\n<div id=\"altair-viz-b36eb15539894999ad2208e32ee63c31\"></div>\n<script type=\"text/javascript\">\n  var VEGA_DEBUG = (typeof VEGA_DEBUG == \"undefined\") ? {} : VEGA_DEBUG;\n  (function(spec, embedOpt){\n    let outputDiv = document.currentScript.previousElementSibling;\n    if (outputDiv.id !== \"altair-viz-b36eb15539894999ad2208e32ee63c31\") {\n      outputDiv = document.getElementById(\"altair-viz-b36eb15539894999ad2208e32ee63c31\");\n    }\n    const paths = {\n      \"vega\": \"https://cdn.jsdelivr.net/npm/vega@5?noext\",\n      \"vega-lib\": \"https://cdn.jsdelivr.net/npm/vega-lib?noext\",\n      \"vega-lite\": \"https://cdn.jsdelivr.net/npm/vega-lite@5.17.0?noext\",\n      \"vega-embed\": \"https://cdn.jsdelivr.net/npm/vega-embed@6?noext\",\n    };\n\n    function maybeLoadScript(lib, version) {\n      var key = `${lib.replace(\"-\", \"\")}_version`;\n      return (VEGA_DEBUG[key] == version) ?\n        Promise.resolve(paths[lib]) :\n        new Promise(function(resolve, reject) {\n          var s = document.createElement('script');\n          document.getElementsByTagName(\"head\")[0].appendChild(s);\n          s.async = true;\n          s.onload = () => {\n            VEGA_DEBUG[key] = version;\n            return resolve(paths[lib]);\n          };\n          s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n          s.src = paths[lib];\n        });\n    }\n\n    function showError(err) {\n      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n      throw err;\n    }\n\n    function displayChart(vegaEmbed) {\n      vegaEmbed(outputDiv, spec, embedOpt)\n        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n    }\n\n    if(typeof define === \"function\" && define.amd) {\n      requirejs.config({paths});\n      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n    } else {\n      maybeLoadScript(\"vega\", \"5\")\n        .then(() => maybeLoadScript(\"vega-lite\", \"5.17.0\"))\n        .then(() => maybeLoadScript(\"vega-embed\", \"6\"))\n        .catch(showError)\n        .then(() => displayChart(vegaEmbed));\n    }\n  })({\"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"layer\": [{\"layer\": [{\"mark\": \"rule\", \"encoding\": {\"color\": {\"value\": \"black\"}, \"size\": {\"value\": 0.5}, \"y\": {\"field\": \"zero\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"bar\", \"width\": 60}, \"encoding\": {\"color\": {\"condition\": {\"test\": \"(datum.log2_bayes_factor < 0)\", \"value\": \"red\"}, \"value\": \"green\"}, \"opacity\": {\"condition\": {\"test\": \"datum.column_name == 'Prior match weight' || datum.column_name == 'Final score'\", \"value\": 1}, \"value\": 0.5}, \"tooltip\": [{\"field\": \"column_name\", \"title\": \"Comparison column\", \"type\": \"nominal\"}, {\"field\": \"value_l\", \"title\": \"Value (L)\", \"type\": \"nominal\"}, {\"field\": \"value_r\", \"title\": \"Value (R)\", \"type\": \"nominal\"}, {\"field\": \"label_for_charts\", \"title\": \"Label\", \"type\": \"ordinal\"}, {\"field\": \"sql_condition\", \"title\": \"SQL condition\", \"type\": \"nominal\"}, {\"field\": \"comparison_vector_value\", \"title\": \"Comparison vector value\", \"type\": \"nominal\"}, {\"field\": \"bayes_factor\", \"format\": \",.4f\", \"title\": \"Bayes factor = m/u\", \"type\": \"quantitative\"}, {\"field\": \"log2_bayes_factor\", \"format\": \",.4f\", \"title\": \"Match weight = log2(m/u)\", \"type\": \"quantitative\"}, {\"field\": \"prob\", \"format\": \".4f\", \"title\": \"Cumulative match probability\", \"type\": \"quantitative\"}, {\"field\": \"bayes_factor_description\", \"title\": \"Match weight description\", \"type\": \"nominal\"}], \"x\": {\"axis\": {\"grid\": true, \"labelAlign\": \"center\", \"labelAngle\": -20, \"labelExpr\": \"datum.value == 'Prior' || datum.value == 'Final score' ? '' : datum.value\", \"labelPadding\": 10, \"tickBand\": \"extent\", \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"axis\": {\"grid\": false, \"orient\": \"left\", \"title\": \"Match Weight\"}, \"field\": \"previous_sum\", \"type\": \"quantitative\"}, \"y2\": {\"field\": \"sum\"}}}, {\"mark\": {\"type\": \"text\", \"fontWeight\": \"bold\"}, \"encoding\": {\"color\": {\"value\": \"white\"}, \"text\": {\"condition\": {\"test\": \"abs(datum.log2_bayes_factor) > 1\", \"field\": \"log2_bayes_factor\", \"format\": \".2f\", \"type\": \"nominal\"}, \"value\": \"\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"axis\": {\"orient\": \"left\"}, \"field\": \"center\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"text\", \"baseline\": \"bottom\", \"dy\": -25, \"fontWeight\": \"bold\"}, \"encoding\": {\"color\": {\"value\": \"black\"}, \"text\": {\"field\": \"column_name\", \"type\": \"nominal\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"field\": \"sum_top\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"text\", \"baseline\": \"bottom\", \"dy\": -13, \"fontSize\": 8}, \"encoding\": {\"color\": {\"value\": \"grey\"}, \"text\": {\"field\": \"value_l\", \"type\": \"nominal\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"field\": \"sum_top\", \"type\": \"quantitative\"}}}, {\"mark\": {\"type\": \"text\", \"baseline\": \"bottom\", \"dy\": -5, \"fontSize\": 8}, \"encoding\": {\"color\": {\"value\": \"grey\"}, \"text\": {\"field\": \"value_r\", \"type\": \"nominal\"}, \"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"y\": {\"field\": \"sum_top\", \"type\": \"quantitative\"}}}]}, {\"mark\": {\"type\": \"rule\", \"color\": \"black\", \"strokeWidth\": 2, \"x2Offset\": 30, \"xOffset\": -30}, \"encoding\": {\"x\": {\"axis\": {\"labelAngle\": -20, \"title\": \"Column\"}, \"field\": \"column_name\", \"sort\": {\"field\": \"bar_sort_order\", \"order\": \"ascending\"}, \"type\": \"nominal\"}, \"x2\": {\"field\": \"lead\"}, \"y\": {\"axis\": {\"labelExpr\": \"format(1 / (1 + pow(2, -1*datum.value)), '.2r')\", \"orient\": \"right\", \"title\": \"Probability\"}, \"field\": \"sum\", \"scale\": {\"zero\": false}, \"type\": \"quantitative\"}}}], \"data\": {\"name\": \"data-ba04a1d93ab136767e2f8b36eb8f6574\"}, \"height\": 450, \"params\": [{\"name\": \"record_number\", \"bind\": {\"input\": \"range\", \"max\": 0, \"min\": 0, \"step\": 1}, \"value\": 0}], \"resolve\": {\"axis\": {\"y\": \"independent\"}}, \"title\": {\"text\": \"Match weights waterfall chart\", \"subtitle\": \"How each comparison contributes to the final match score\"}, \"transform\": [{\"filter\": \"(datum.record_number == record_number)\"}, {\"window\": [{\"op\": \"sum\", \"field\": \"log2_bayes_factor\", \"as\": \"sum\"}, {\"op\": \"lead\", \"field\": \"column_name\", \"as\": \"lead\"}], \"frame\": [null, 0]}, {\"calculate\": \"datum.column_name === \\\"Final score\\\" ? datum.sum - datum.log2_bayes_factor : datum.sum\", \"as\": \"sum\"}, {\"calculate\": \"datum.lead === null ? datum.column_name : datum.lead\", \"as\": \"lead\"}, {\"calculate\": \"datum.column_name === \\\"Final score\\\" || datum.column_name === \\\"Prior match weight\\\" ? 0 : datum.sum - datum.log2_bayes_factor\", \"as\": \"previous_sum\"}, {\"calculate\": \"datum.sum > datum.previous_sum ? datum.column_name : \\\"\\\"\", \"as\": \"top_label\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? datum.column_name : \\\"\\\"\", \"as\": \"bottom_label\"}, {\"calculate\": \"datum.sum > datum.previous_sum ? datum.sum : datum.previous_sum\", \"as\": \"sum_top\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? datum.sum : datum.previous_sum\", \"as\": \"sum_bottom\"}, {\"calculate\": \"(datum.sum + datum.previous_sum) / 2\", \"as\": \"center\"}, {\"calculate\": \"(datum.log2_bayes_factor > 0 ? \\\"+\\\" : \\\"\\\") + datum.log2_bayes_factor\", \"as\": \"text_log2_bayes_factor\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? 4 : -4\", \"as\": \"dy\"}, {\"calculate\": \"datum.sum < datum.previous_sum ? \\\"top\\\" : \\\"bottom\\\"\", \"as\": \"baseline\"}, {\"calculate\": \"1. / (1 + pow(2, -1.*datum.sum))\", \"as\": \"prob\"}, {\"calculate\": \"0*datum.sum\", \"as\": \"zero\"}], \"width\": {\"step\": 75}, \"$schema\": \"https://vega.github.io/schema/vega-lite/v5.9.3.json\", \"datasets\": {\"data-ba04a1d93ab136767e2f8b36eb8f6574\": [{\"column_name\": \"Prior\", \"label_for_charts\": \"Starting match weight (prior)\", \"sql_condition\": null, \"log2_bayes_factor\": -5.391889789559854, \"bayes_factor\": 0.023816582302252427, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 0, \"record_number\": 0}, {\"column_name\": \"first_name\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"first_name_l = first_name_r\", \"log2_bayes_factor\": 6.452385051922501, \"bayes_factor\": 87.57122888658395, \"comparison_vector_value\": 2, \"m_probability\": 0.5073501669215337, \"u_probability\": 0.0057935713975033705, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 87.57 times more likely to be a match\", \"value_l\": \"Lucas\", \"value_r\": \"Lucas\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 1, \"record_number\": 0}, {\"column_name\": \"tf_first_name\", \"label_for_charts\": \"Term freq adjustment on first_name with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"first_name_l = first_name_r\", \"log2_bayes_factor\": 2.267373341558131, \"bayes_factor\": 4.814457831325301, \"comparison_vector_value\": 2, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on first_name makes comparison 4.81 times more likely to be a match\", \"value_l\": \"Lucas\", \"value_r\": \"Lucas\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 2, \"record_number\": 0}, {\"column_name\": \"surname\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"surname_l = surname_r\", \"log2_bayes_factor\": 6.529599913880287, \"bayes_factor\": 92.38584465067325, \"comparison_vector_value\": 2, \"m_probability\": 0.4517645215191846, \"u_probability\": 0.004889975550122249, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 92.39 times more likely to be a match\", \"value_l\": \"Smith\", \"value_r\": \"Smith\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 3, \"record_number\": 0}, {\"column_name\": \"tf_surname\", \"label_for_charts\": \"Term freq adjustment on surname with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"surname_l = surname_r\", \"log2_bayes_factor\": -1.4576690099380376, \"bayes_factor\": 0.3640809068681929, \"comparison_vector_value\": 2, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on surname makes comparison  2.75 times less likely to be a match\", \"value_l\": \"Smith\", \"value_r\": \"Smith\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 4, \"record_number\": 0}, {\"column_name\": \"dob\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": -2.114723717091652, \"bayes_factor\": 0.23088978993311773, \"comparison_vector_value\": 0, \"m_probability\": 0.22653362300553073, \"u_probability\": 0.9811331331331331, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.33 times less likely to be a match\", \"value_l\": \"1984-01-02\", \"value_r\": \"1983-02-12\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 5, \"record_number\": 0}, {\"column_name\": \"tf_dob\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 0, \"m_probability\": 0.22653362300553073, \"u_probability\": 0.9811331331331331, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  4.33 times less likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 6, \"record_number\": 0}, {\"column_name\": \"city\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": -1.1635794871398053, \"bayes_factor\": 0.4464035832880252, \"comparison_vector_value\": 0, \"m_probability\": 0.4217855099035769, \"u_probability\": 0.9448524288198547, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.24 times less likely to be a match\", \"value_l\": \"London\", \"value_r\": \"Machester\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 7, \"record_number\": 0}, {\"column_name\": \"tf_city\", \"label_for_charts\": \"All other comparisons\", \"sql_condition\": \"ELSE\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 0, \"m_probability\": 0.4217855099035769, \"u_probability\": 0.9448524288198547, \"bayes_factor_description\": \"If comparison level is `all other comparisons` then comparison is  2.24 times less likely to be a match\", \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 8, \"record_number\": 0}, {\"column_name\": \"email\", \"label_for_charts\": \"exact_match\", \"sql_condition\": \"email_l = email_r\", \"log2_bayes_factor\": 8.04017554864013, \"bayes_factor\": 263.2291676754963, \"comparison_vector_value\": 1, \"m_probability\": 0.5774909200578013, \"u_probability\": 0.0021938713143283602, \"bayes_factor_description\": \"If comparison level is `exact_match` then comparison is 263.23 times more likely to be a match\", \"value_l\": \"lucas.smith@hotmail.com\", \"value_r\": \"lucas.smith@hotmail.com\", \"term_frequency_adjustment\": false, \"bar_sort_order\": 9, \"record_number\": 0}, {\"column_name\": \"tf_email\", \"label_for_charts\": \"Term freq adjustment on email with weight {cl.tf_adjustment_weight}\", \"sql_condition\": \"email_l = email_r\", \"log2_bayes_factor\": 0.0, \"bayes_factor\": 1.0, \"comparison_vector_value\": 1, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": \"Term frequency adjustment on email makes comparison 1.00 times more likely to be a match\", \"value_l\": \"lucas.smith@hotmail.com\", \"value_r\": \"lucas.smith@hotmail.com\", \"term_frequency_adjustment\": true, \"bar_sort_order\": 10, \"record_number\": 0}, {\"column_name\": \"Final score\", \"label_for_charts\": \"Final score\", \"sql_condition\": null, \"log2_bayes_factor\": 13.1616718522717, \"bayes_factor\": 9163.429029878096, \"comparison_vector_value\": null, \"m_probability\": null, \"u_probability\": null, \"bayes_factor_description\": null, \"value_l\": \"\", \"value_r\": \"\", \"term_frequency_adjustment\": null, \"bar_sort_order\": 11, \"record_number\": 0}]}}, {\"mode\": \"vega-lite\"});\n</script>",
                    "text/plain": "alt.LayerChart(...)"
                  },
                  "metadata": {},
                  "output_type": "display_data"
                }
              ],
              "tabbable": null,
              "tooltip": null
            }
          },
          "4f0444bd007f4fb1a2e35bd299cf1989": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "4f4d5437f9574de4a3b98769f2f94d13": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "5831fd1d9a4a4699a1ac8b3f35c67bc3": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "5d4a7365a34746fe9ed2319c19ad0d58": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "658f48614d3d4c63bbdc946d44b9f734": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "68972985dae04505b33533980fc0b970": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "71ef6ceee3034d95a7a718dda4457629": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "first_name",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_4baf8bf6cf784f5ca98feee93978b3af",
              "placeholder": "​",
              "style": "IPY_MODEL_9fc84fac4de14d3abe25a8eeb06fadea",
              "tabbable": null,
              "tooltip": null,
              "value": "Lucas"
            }
          },
          "73f2384489da4b748209c462724a3961": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "first_name",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_773e45ebabda4dc0aafd521d3aa3e6a8",
              "placeholder": "​",
              "style": "IPY_MODEL_c8a47b61ac8e41c3b0c85fbbf31a4c24",
              "tabbable": null,
              "tooltip": null,
              "value": "Robert"
            }
          },
          "773e45ebabda4dc0aafd521d3aa3e6a8": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "7c52d046223c4607b35759a148cc8515": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "80683606961c4187965cc00e4944fbe1": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "8456ddacbc5542c2a9d668d042a6abe6": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "968249064f3446ee806ef5e750085fe4": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "VBoxModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "VBoxModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "VBoxView",
              "box_style": "",
              "children": [
                "IPY_MODEL_e7d7652b464b413283dd5a057dd68aaf",
                "IPY_MODEL_71ef6ceee3034d95a7a718dda4457629",
                "IPY_MODEL_c1d56f96db3a492b88776c47754d6cf1",
                "IPY_MODEL_1fa9c4a8c62846f591a1fb4e4d91d3ed",
                "IPY_MODEL_329729744d0c4e839c0503ab0259b18c",
                "IPY_MODEL_e9b46eb9fbcb4aa8a569749fa50fcff3"
              ],
              "layout": "IPY_MODEL_e3c8bdbb08184f979824e4993cec1f63",
              "tabbable": null,
              "tooltip": null
            }
          },
          "9fc84fac4de14d3abe25a8eeb06fadea": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "a2c309f444944797824589147aede89d": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "aa3e943234ac46ca8d4530ab22443b0e": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "ab457eac76f942508d6f75ff109bbd61": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "b50d412867114f2eb000fc969b677c9c": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "email",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_440256de4ff2405e95431f2fd9490436",
              "placeholder": "​",
              "style": "IPY_MODEL_aa3e943234ac46ca8d4530ab22443b0e",
              "tabbable": null,
              "tooltip": null,
              "value": "robert255@smith.net"
            }
          },
          "b571fbb3f6a14611974779e927914d23": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "dob",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_3e98708a97934bb095b2be73187fcec0",
              "placeholder": "​",
              "style": "IPY_MODEL_fdd25b8bb828465e83f7a3c452ccbfc1",
              "tabbable": null,
              "tooltip": null,
              "value": "1971-05-24"
            }
          },
          "b7e0ec811eba4e59804eca1852402423": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "c1d56f96db3a492b88776c47754d6cf1": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "surname",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_68972985dae04505b33533980fc0b970",
              "placeholder": "​",
              "style": "IPY_MODEL_11bbe083b862406d814c35e47d773ade",
              "tabbable": null,
              "tooltip": null,
              "value": "Smith"
            }
          },
          "c2e6efd78b2148f3a026c6179fdbf683": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "c651dbf1a60b4f219d31355ec3d9d1cd": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "city",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_5831fd1d9a4a4699a1ac8b3f35c67bc3",
              "placeholder": "​",
              "style": "IPY_MODEL_b7e0ec811eba4e59804eca1852402423",
              "tabbable": null,
              "tooltip": null,
              "value": "Machester"
            }
          },
          "c71b8b6aa86343a7b0093f15313677f7": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "c8a47b61ac8e41c3b0c85fbbf31a4c24": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "ca1c754b37a640a69908cb2b34cb7b3c": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "cb0b167a052745fd9204729f961b7ad6": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "cc0ddc91bbfb4c6d891c202e279d4c74": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "city",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_e460aba5b4c34695a30ea7008b5b7cfd",
              "placeholder": "​",
              "style": "IPY_MODEL_ab457eac76f942508d6f75ff109bbd61",
              "tabbable": null,
              "tooltip": null,
              "value": "London"
            }
          },
          "d27918510cb3494c930c545563fed3ca": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "surname",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_23d4adc30abf4b8c845e3a22a7929ada",
              "placeholder": "​",
              "style": "IPY_MODEL_c2e6efd78b2148f3a026c6179fdbf683",
              "tabbable": null,
              "tooltip": null,
              "value": "Alan"
            }
          },
          "de296f36c45e4161a6c3d091dfea2892": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "e3c8bdbb08184f979824e4993cec1f63": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "e460aba5b4c34695a30ea7008b5b7cfd": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "e7d7652b464b413283dd5a057dd68aaf": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "unique_id",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_4f4d5437f9574de4a3b98769f2f94d13",
              "placeholder": "​",
              "style": "IPY_MODEL_1b024ddb36284e4b85b5054092f531bc",
              "tabbable": null,
              "tooltip": null,
              "value": "1"
            }
          },
          "e9b46eb9fbcb4aa8a569749fa50fcff3": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextModel",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "2.0.0",
              "_view_name": "TextView",
              "continuous_update": true,
              "description": "city",
              "description_allow_html": false,
              "disabled": false,
              "layout": "IPY_MODEL_250e8abe119446478ca7513778aed39a",
              "placeholder": "​",
              "style": "IPY_MODEL_4f0444bd007f4fb1a2e35bd299cf1989",
              "tabbable": null,
              "tooltip": null,
              "value": "London"
            }
          },
          "ecb562219597492fae7b4bf881ea113f": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "f3de223015854925895cbd794a7ee8c2": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "fdd25b8bb828465e83f7a3c452ccbfc1": {
            "model_module": "@jupyter-widgets/controls",
            "model_module_version": "2.0.0",
            "model_name": "TextStyleModel",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "2.0.0",
              "_model_name": "TextStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "StyleView",
              "background": null,
              "description_width": "",
              "font_size": null,
              "text_color": null
            }
          },
          "ffdf7e9a14d04f6b9a448df89e8ffbec": {
            "model_module": "@jupyter-widgets/base",
            "model_module_version": "2.0.0",
            "model_name": "LayoutModel",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "2.0.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "2.0.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border_bottom": null,
              "border_left": null,
              "border_right": null,
              "border_top": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          }
        },
        "version_major": 2,
        "version_minor": 0
      }
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}
